Re: eofunc

From: Dennis Shea <shea_at_nyahnyahspammersnyahnyah>
Date: Wed, 21 Feb 2007 06:34:33 -0700 (MST)

Hello

eofcov was the original function used to calculate EOFs.
It was my own code. Basically, it calculated the covariance
matrix in symmetric storage mode. Then it used an LAPACK
routine to calculate the eigenvectors.

This function could be slow if the the number of
spatial points was large.

To address this concerm, NCL created eofunc.
This examined the the relative size of the spatial [S]
and temporal [T] dimensions.

It then solved the smaller SxS or TxT covariance matrix.

The max number of unique eigenvalues for an SxT system
is min(T,S).

Unfortunately, systems is going to take my machine
down for maintemence so I have to stop here.

D

On Wed, 21 Feb 2007, ozan mert gokturk wrote:

> 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
>
>
_______________________________________________
ncl-talk mailing list
ncl-talk_at_ucar.edu
http://mailman.ucar.edu/mailman/listinfo/ncl-talk
Received on Wed Feb 21 2007 - 06:34:33 MST

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