sparse_covariance_est.m glaring bug?

In the example sparse_covariance_est.m, the “zeroness” of a matrix element is decided with the following line:

S(find(S<1e-4)) = 0

I believe the correct line should be:

S(find(abs(S)<1e-4)) = 0

and when you change this in the example, there are no entries in the matrix that equal 0.

N should probably be increased to 1000, as I don’t think 100 samples is a reasonable number of samples to determine ~50 unique covariance parameters. Finally, to get a decent sparse estimation, alpha=2 seems to work well.

Thanks for the report! We’ll take a look.