필터 지우기
필터 지우기

Obtaining EOF's from svds, orientation changes each time

조회 수: 3 (최근 30일)
eduardoq
eduardoq 2013년 1월 22일
댓글: Javier 2014년 12월 18일
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