metno / esd

An R-package designed for climate and weather data analysis, empirical-statistical downscaling, and visualisation.
88 stars 30 forks source link

Issue with eofs #201

Closed javakh closed 8 years ago

javakh commented 8 years ago

image

Here it is showing that explained variance of first eof is 97.23%. However eigen value calculation showing it is 76.85%.

attr(eof,"eigenvalues") [1] 299.2540732 43.2121289 23.3074795 9.1225628 5.6819929 3.8916414 [7] 1.8170970 1.4254331 0.6762520 0.4360433 0.3740890 0.1836595 e=attr(eof,"eigenvalues") sum(e) [1] 389.3825 e[1]/sum(e) [1] 0.7685351

This is a bit confusing.

brasmus commented 8 years ago

Good question! The variance is the squared eigenvalue: e[1]^2/sum(e^2)*100 = 97.23418.

javakh commented 8 years ago

I may be wrong but I have found this definition of explained variance in some statistics book including "STATISTICAL METHODS IN THE ATMOSPHERIC SCIENCES" by DS Wilks.