Closed myxa closed 8 months ago
Hi, from the error message it seems, that it calls the solver for multiple Graphical Lasso problems (ADMM_MGL).
In that case, fc_cl
should be a (K,p,p) array, where each fc_cl[k,:,:]
should be a symmetric matrix.
Did you verify this? What is K
and p
in your example?
Also I noticed that the second argument should be the number of samples, which is in general not the same as len(fc_cl)
. Note that fc_cl
should already be a covariance matrix (that is, not a data array of shape [num_samples, p]
).
Thank you for your answer!
Here fc_cl
is an array of covariance matrices, every matrix is symmetric, and shape of fc_cl
is [84, 116, 116].
But now I'm confused now about term "num of samples". Here I have data for 84 people, and therefore I have 84 samples?
In addition, mentioned error is raised on 50th iteration only.
Ok, got it. So the second argument is the number of samples you had for computing the covariance matrix.
If, for example, for each of the 84 arrays the matrix was computed from 100 samples, then set N=100
(if the number of samples is different for each of the 84, you can also input an array for N
.
Regarding the symmetry: this can happen due to rounding issues I guess; this assertion might be too overcautious. I would recommend to either try to increase the tolerance (that is, set 1e-5
to a higher number in the line that throws the error), or comment out that line entirely. Let me know what happens.
If I change tolerance, it fails, but at different iterations. If the line is commented out, algorithm runs till termination. The problem is in my data, the matrices are symmetric with certain tolerance too, which is not enough i guess. Thank you for the help!
Trying to run the following code:
P = glasso_problem(fc_cl, len(fc_cl), reg_params={'lambda1': 0.005, 'lambda2': 0.001}, latent=False, do_scaling=False)
I checked all the input data to be symmetric, but still this error appears.