[Numpy-discussion] corrcoef of masked array
Jesper Larsen
jl at dmi.dk
Mon Jun 4 03:22:47 EDT 2007
On Wednesday 30 May 2007 19:48, Robert Kern wrote:
> I'm afraid this doesn't work, either. Correlation matrices are constrained
> to be positive semidefinite; that is, all of their eigenvalues must be >=
> 0. Calculating each of the correlation coefficients in a pairwise fashion
> doesn't incorporate this constraint.
>
> But you're on the right track. My preferred approach to this problem is to
> find the pairwise correlation matrix as you did and then find the closest
> positive semidefinite matrix to it using the method of alternating
> projections. I can't give you the code I wrote for this since it belongs to
> a customer, but here is the reference I used:
>
> http://eprints.ma.man.ac.uk/232/
Robert,
Thanks your comments and for the reference. I will try to implement the
algorithm sometime this month.
Cheers,
Jesper
More information about the NumPy-Discussion
mailing list