ajdawson / eofs

EOF analysis in Python
http://ajdawson.github.io/eofs/
GNU General Public License v3.0
199 stars 60 forks source link

Not found in doc #86

Closed CommonClimate closed 6 years ago

CommonClimate commented 7 years ago

Hi @ajdawson , first of all, thanks for a tremendously useful package. here are a few questions I cannot find in the doc or examples:

Thanks in advance! Julien

ajdawson commented 7 years ago

I often have to multiply both by -1 to get something sensible. How do I do this with your package?

eofs always returns an array-like object for EOFs and PCs (it might be an xarray array or an iris Cube if you are using one of those interfaces) which can be multiplied by -1 in a straightforward way in all cases:

eof1 = solver.eofs(neofs=1)
pc1 = solver.pcs(npcs)
eof1 *= -1
pc1 *= -1

Is that what you wanted to know, or is there more to it?

Is there an easy way to do a scree plot, including the error bars on the eigenvalues? A related feature might be northTest, but I am not quite sure what to do with the numbers it returns.

The northTest method returns the (approximate) sampling error in each eigenvalue. These sampling errors can be interpreted such that if the sampling error for an eigenvalue is comparable in size to the difference between that eigenvalue and the next smallest eigenvalue, then the associated eigenvectors are degenerate. See North et al 1982 for a detailed explanation.

You can plot these as error bars if you like to produce a visualisation of eigenvector degeneracy. The northTest method takes a keyword vfscaled to scale the errors to fractional variance too, if you want the plot to be in fractional variance units instead of eigenvalue units.