Obtaining EOF's from svds, orientation changes each time

2 次查看(过去 30 天)
The orientation of the spatial EOF's keep changing each time I run the script. Im using the svds function with 2 singular values and the orientation of the vectors in the spatial EOF changes each time. Why is this?
  2 个评论
Shashank Prasanna
Shashank Prasanna 2013-1-22
Could you share your code so that we can see why you see different results each time?
eduardoq
eduardoq 2013-1-22
uf=randn(1000,10);
vf=randn(1000,10);
[nx,ny]=size(uf);
um=mean(uf);
vm=mean(vf);
um=ones(nx,1)*um;
vm=ones(nx,1)*vm;
um=uf-(um);
vm=vf-(vm);
um=mean(um,2); vm=mean(vm,2);
A=[um vm];
[U,S,V]=svds(A,2);
s=diag(S);
s=((s.^2)/(sum(s.^2)))*100;

请先登录,再进行评论。

回答(1 个)

Shashank Prasanna
Shashank Prasanna 2013-1-22
Are you running the whole script again, or just the SVD part? Since you are generating random numbers using RANDN you will be performing SVD on completely different numbers each time.
You can either add this command at the beginning of the script such that the same random numbers are generated each time.
>> rng(0) ;
>> %%%Rest of your code %%%
Or you can re run only the last 3 lines of code from SVDS so that you perform SVD on the same data again. You will see that the result must be consistent.
  3 个评论
Shashank Prasanna
Shashank Prasanna 2013-1-22
Can you reproduce this issue with a smaller subset of your data? How off are your results wrt to precision of numbers?
Javier
Javier 2014-12-18
I have a little doubt about the procedure to compute the real-vector EOF: considering that I have N grid points with velocities for T time steps, I understand that I have to apply the svd decomposition to a 2NxT matrix where the first N rows correspond to the U points and the N+1 to 2N rows correspond to V. My doubt is: once the decomposition is performed (for example for the first 10 EOF modes) I obtain a 2Nx10 EOF matrix. Here I understand that again the first N rows correspond to the U component for that mode and from N+1 to 2N to V. Is it that correct? I'd really appreciate any help.
Thanks

请先登录,再进行评论。

类别

Help CenterFile Exchange 中查找有关 Eigenvalues 的更多信息

标签

产品

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by