Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MI values when cholesky failed #2

Open
EtienneCmb opened this issue Mar 16, 2020 · 5 comments
Open

MI values when cholesky failed #2

EtienneCmb opened this issue Mar 16, 2020 · 5 comments
Labels
bug Something isn't working

Comments

@EtienneCmb
Copy link
Collaborator

@nvoges @brovelli

The current version of the code failed on Nicoles' simulated data, because of the cholesky decomposition when the data are redundant.

@brovelli suggested np.clip(mi, 0, mi). This avoid negative MI values (I think it should also works on negative infinite). @nvoges do you get infinite values or NaN values? Because if NaN, the clip is not going to make a difference. In addition, I've seen negative MI because of the bias correction so I'm not sure it's a good idea to put a hard threshold at 0, especially because we also compute permutations and I'm afraid of having many permutations to zero because of that.

What do u think?

@EtienneCmb EtienneCmb added the bug Something isn't working label Mar 16, 2020
@brovelli
Copy link
Member

You are right, np.clip(mi, 0, mi) cannot work for biased corrected GCMI values.

BUT, you can make the np.clip(mi, 0, mi) before computing the bias corrected values

@EtienneCmb
Copy link
Collaborator Author

Ok, it should works indeed. But @nvoges should clarify if she gets infinite or nan values before fixing it

@nvoges
Copy link

nvoges commented Mar 16, 2020 via email

@EtienneCmb
Copy link
Collaborator Author

Ok, in that case, the np.clip is not going to fix your issue. One possibility :

try:
    chcx = np.linalg.cholesky(cx)
except:
    return 0

If the cholesky decomposition failed, the returned MI is set to 0. But I'm hesitating of putting it in the gcmi_nd.py functions because I'm afraid of having new silent errors with MI and permuted MI set to zero because it silently fail...

I'm really not sure this should be included in Frites, I think it might be dangerous for us

@EtienneCmb
Copy link
Collaborator Author

Maybe with an additional error message...

@brovelli what do you think?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants