Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

about the difference between .pcs() and .projectField() #135

Open
AndreaVitoVacca opened this issue Mar 10, 2023 · 0 comments
Open

about the difference between .pcs() and .projectField() #135

AndreaVitoVacca opened this issue Mar 10, 2023 · 0 comments

Comments

@AndreaVitoVacca
Copy link

AndreaVitoVacca commented Mar 10, 2023

dear @ajdawson ,
thank you very much for this package. I am using eofs.xarray.Eof() to reduce the space dimensionality on which to compute a clustering algorithm to extract atmospheric circulation pattern. In particular, I am applying the clustering on the PCS of a field of daily geopotential height anomalies. I am having unexpected wrong results when using .pcs(), but right results if I use instead the .projectField(). In this framework my doubt is the following:
My theoretical understanding of the topic leads me expect that If i project the field on the EOF space obtained from the field itself (.projectField()), the resulting pseudo-pcs should be exactly the same as the pcs (or at least pretty similar). I tried this with different datasets and saw that this is not the case (the pseudo-pcs are different from pcs). I also tried to dive into the souce code, without clarifying my ideas. Could you please give me a rationale for this behavior?

this could help to interpret my results and understand when to use .projectField() and .pcs() for my purposes. For completeness, I attach some line of the code I am using. Thank you for the attention, I apologies for the issue not strictly related to errors in the code but more on the understanding of the outputs.
Kind regards,
Andrea Vito Vacca

eof = eofs.xarray.Eof(field,weights=wgts)
pcs = eof.pcs(npcs=4)
pseudo_pcs=eof.projectField(field,neofs=4)
clus1 = KMeans(n_clusters=4,random_state=100).fit(pcs) # wrong results
clus2 = KMeans(n_clusters=4,random_state=100).fit(pseudo_pcs) # right results

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant