-
Notifications
You must be signed in to change notification settings - Fork 28
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
random correction #139
random correction #139
Conversation
Thanks @EnricaBelfiore , I will have a look. But first I'll wait that you finish the tests |
I made these changes without inserting the negative eigenvalues equal to zero because this is done by the to_positive method. I prefer to drop that method and insert the cut here if you agree. |
We agreed the eig method will remove eigenvalues given a tolerance. |
""" | ||
Extract eigenvalues and eigenvectors. | ||
|
||
Parameters | ||
---------- | ||
sort : `bool`, optional, default is `True` | ||
flag to return sorted eigenvalues and eigenfunctions | ||
tolerance : `float`, optional, default is `None` | ||
truncation proportional to the magnitude of the largest positive eigenvalue, | ||
e.g. 1000 to cut all the eigenvalues 1000 times lower than the largest eigenvalue | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What if you want to remove only negative eigs? What can the user do?
The random_corr method implemented did not work for matrices with a dimention higher than 30x30 because it returned a matrix not always positive definite nor symettrical (for numerical fluctuations). With this correction the matrix will allow for the creation of a category cov instance up until size 10000x10000 (bigger matrix gives memory issues, in the previous implementation as well), but some eigenvalues could be
-1e-18
or in this range (numerical approximation of zero).The method _reduce_size is modified because it did not work for a real covariance matrix.
P.s. even if we will change the decomposition it should be mantained because it is used also for different methods (invert, _gls_G_inv)