Re: eofunc

From: ozan mert gokturk <gokturko_at_nyahnyahspammersnyahnyah>
Date: Wed, 21 Feb 2007 14:38:54 +0200

Hi Takeshi,

I used eofcov() instead of eofunc(), and saw that returned eigenvalues were
correct.
Eofunc reduces the input data matrix in a way that I cannot exactly
remember, so
the eigenvalues returned are different. I think Mr.Shea has an explanation for
this (I read that explanation somewhere, but can't remember where..)

Ozan

Quoting Takeshi Enomoto <eno_at_jamstec.go.jp>:

> Hello,
>
> I have a problem with the amplitude
> of the eigenvalues returned by eofunc().
>
> So looked at a simple example and am trying to confirm
> eigenvalue = (singular value)**2/N
> using svd_lapack() and eofunc().
>
> The factor pertains to the calculation of covariance.
> How does eofunc() calculates the covariance?
>
> BTW, In Prof Hartmann's example using MATLAB
> (I tried it with octave),
> eigenvalue = (singular value)**2
> and the sample size is gone somewhere.
>
> Takeshi
>
> -----
> ; Prof. D.L. Hartmann http://www.atmos.washington.edu/~dennis/
> ; ATM 552 Notes Chapter 4
> ; SVD and EOF MATLAB example
>
> load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/contributed.ncl"
> begin
> nc = 4; number of columns
> nr = 2; number of rows
>
> ; octave: [2 4 -6 8; 1 2 -3 4] [row 1; row2] but column-major
> internally as Fortran
> ; NCL: (/(/row 1; row 2/)/) row-major as C
>
> a = (/(/2.,4.,-6.,8./),(/1.,2.,-3.,4./)/)
> printVarSummary(a)
> atr = transpose(a)
> printVarSummary(atr)
>
> ; svd_lapack() expects input transposed manually
>
> print("### SVD ###")
> write_matrix(atr,nc+"F8.4",False)
> u = new((/nr,nr/),float)
> v = new((/nc,nc/),float)
> s = svd_lapack(atr, "S", "S", 0, u, v)
> write_matrix(transpose(u),nr+"F8.4",False)
> print(s)
> write_matrix(v,nc+"F8.4",False)
>
> print("### EOF ###")
> ; c = a # atr
> ; write_matrix(c,nc+"F8.4",False)
>
> eof = eofunc(a,1,False)
>
> print(eof_at_eval)
> print(eof_at_pcvar)
> print(eof_at_matrix)
> print(eof_at_method)
>
> write_matrix(eof,nr+"F8.4",False)
> end
>
> _______________________________________________
> ncl-talk mailing list
> ncl-talk_at_ucar.edu
> http://mailman.ucar.edu/mailman/listinfo/ncl-talk
>

----------------------------------------------------------------
This message was sent using IMP, the Internet Messaging Program.

_______________________________________________
ncl-talk mailing list
ncl-talk_at_ucar.edu
http://mailman.ucar.edu/mailman/listinfo/ncl-talk
Received on Wed Feb 21 2007 - 05:38:54 MST

This archive was generated by hypermail 2.2.0 : Thu Feb 22 2007 - 14:54:01 MST