Factorization of Cholesky

within my MATLAB code, I have to deal with Cholesky factorization of a specific given matrix. I usually call chol(A,'lower') to create a lower triangular factor.

Now, checking my code with profiler , it is obvious that the chol function really takes a lot of time, especially if the size of the input matrix becomes large.

Therefore, I would like to know if there is a valuable alternative to the chol built-in function.

I was thinking about the LAPACK library, namely the spptrf function. Is it available in MATLAB or not?

Any hints or support is more than welcome.

EDIT

As an example, the profiler retrieves this information:

enter image description here

where Coh_u has a size (1395*1395) . It should also be noted that chol is called 4000 times, since I need a cholez factor for 4000 different configurations.

+6
source share
2 answers

I'm not sure which version of Matlab you are using, but I found this discussion that suggests in older versions that Cholesky Factorization was very slow as you describe.

One answer says to use the CHOLMOD or SuiteSparse package , which has a chol2 function, which should be faster.

+1
source

Can you confirm the correct expression for Coh_u as under

a) Coh_u = exp(-a.*sqrt((f(ii)/Uhub).^2 + (0.12/Lc).^2)).*(df.*psd(ii,1));

or

b) Coh_u = exp(-a.*dist*sqrt((f(ii)/Uhub).^2 + (0.12/Lc).^2)).*(df.*psd(ii,1));

The difference in a) and b) is that in b) dist added, which is the distance between two matrices Y an Z such that

 dist = pdist2([Y(:) Z(:)],[Y(:) Z(:)]); 

But this leads to the "Matrix is ​​not positive definite" error using the chol() function.

0
source

All Articles