Cholesky decomposition #133
Replies: 13 comments 35 replies
-
Correct implementation of the covariance matrix decomposition is also needed to test the convergence of mean/std for the sampling according to a lognormal distribution. |
Beta Was this translation helpful? Give feedback.
-
@EnricaBelfiore ,this is very helpful! Can you report here a simple test where the current method fails. |
Beta Was this translation helpful? Give feedback.
-
I see three methods already developed. Is sparsity needed? How do we handle negative eigenvalues? |
Beta Was this translation helpful? Give feedback.
-
The problem is that there are rows full of zeros, so the determinant is automatically zero. |
Beta Was this translation helpful? Give feedback.
-
Can we agree that we need methods:
Please, provide feedback |
Beta Was this translation helpful? Give feedback.
-
qr decomposition is not working for a real covariance matrix (Pu-241 compute with njoy for 241 groups with a covariance matrix 11809 X 11809). There is a lot of numerical fluctuation. |
Beta Was this translation helpful? Give feedback.
-
@AitorBengoechea , can you fix the implementation? Only one method. If sparsity is too difficult to implement we neglect it for the moment. To make this clear, the purpose of the The decomposition could call the eig method if needed. The eig method could be adjusted if the decomposition cannot handle the existing implementation. In that case the justification should be reported in the eig docstring. |
Beta Was this translation helpful? Give feedback.
-
Thanks to @EnricaBelfiore and @GrimFe for the help. For the moment, with the methods available in sandy.cov and the qr decomposition (introducing a threshold and sparse calculations), the results of the decomposition and reconstruction of the covariance matrix is equal to the original one (size 637 X 637) |
Beta Was this translation helpful? Give feedback.
-
@EnricaBelfiore and @GrimFe , is this issue fully associated to the eigenvalues problem? If we change the eig method, will this still be an issue. Can we clearly state what the problem is here? |
Beta Was this translation helpful? Give feedback.
-
@EnricaBelfiore , @luca-fiorito-11 and @GrimFe : Decomposition problem solved. We are going to select the qr decomposition. My results are the following: Problem size and description: Pu-241 xs computed with njoy for 241 energy groups with a covariance matrix 11809 X 11809 Eigenvalues and eigenvectors obtained in 8-10 minutes A = V.dot(E), then the transpose and finally the qr decomposition: between 20s to 2 min Reconstruction of the covariance matrix: between 3 min to 4 min Results: comparison of the relative difference of the original covariance matrix and the reconstructed one:
|
Beta Was this translation helpful? Give feedback.
-
|
Beta Was this translation helpful? Give feedback.
-
FYI, have a look at the Wiki page about cholesky and its proof by QR decomposition |
Beta Was this translation helpful? Give feedback.
-
@AitorBengoechea , |
Beta Was this translation helpful? Give feedback.
-
@luca-fiorito-11 @AitorBengoechea
I and @GrimFe noticed that the last modification introduced in the sampling procedure does not work for all nuclear data covariance matrices. More in the details, we tested it for covariances of Pu239, U235, U233 and H1.
First of all, was this method already tested with real test cases? In case it was, which nuclides did you use for testing @AitorBengoechea?
We think that this problem is related to the fact that the covarinace for nuclear data are not always positive defined. As far as we understand,
to_positive
method handles this by transforming such matrices into SEMI-positive defined matrices. LU decomposition implemented insidesparse_table_cholesky
method does not properly work for singular matrix (det=0).We propose to back up to the previous decomposition scheme (cov = UDU.T) and to return L=U*sqrt(D), so that cov=L*L.T, where cov is the semipositive approximation of the nuclear data covariance matrix.
Unfortunately,
scipy.linalg.ldl
(implementing UDU.T decomposition) does not handle sparse matrix. Therefore our suggestion is to directly implementscipy.linalg.ldl
decomposition inget_L
. Further possible memory optimization can and should be considered.Beta Was this translation helpful? Give feedback.
All reactions