cca_zoo icon indicating copy to clipboard operation
cca_zoo copied to clipboard

Cannot simulate data

Open JohannesWiesner opened this issue 2 years ago • 2 comments

Hi James, I tried to simulate data using this example, but I get:

LinAlgError: Matrix is not positive definite

JohannesWiesner avatar Jul 26 '23 10:07 JohannesWiesner

I assume you mean you get that error when you run exactly the code in the example? If so could you share scikit-learn version as that's the only place I can think it comes from.

If it's from adding sparsity the Positive Definite problem can happen and you can try changing the random seed a bit.

If you aren't bothered about having a random covariance structure then you can pass

LinearSimulatedData(structure='identity')

which I think works more generally but can make signal recovery more difficult.

jameschapman19 avatar Jul 26 '23 19:07 jameschapman19

LinearSimulatedData(structure='identity') solved it for me but changing the random seed did not have any effect. I am using scikit-learn 1.3.0

JohannesWiesner avatar Jul 31 '23 15:07 JohannesWiesner