eofcor, eofcov, eofcor_ts, eofcov_ts

Empirical orthogonal functions


Synopsis

    function eofcor(
        data[*][*]  : float,
        neval[1] : integer
    )

    function eofcov(
        data[*][*]  : float,
        neval[1] : integer
    )

    function eofcor_ts(
        data[*][*] : float,
        evec[*][*] : float
    )

    function eofcov_ts(
        data[*][*] : float,
        evec[*][*] : float
    )


Arguments

data
2D array dimensioned num_stations x time
neval
Scalar integer that specifies the number of eigenvalues and eigen vectors to be computed
evec
2D array returned from eofcor or eofcov dimensioned neval x num_stations

Description

eofcov computes empirical orthogonal functions (eofs) via the covariance matrix (data) and returns a 2D float array dimensioned neval x num_stations. eofcor computes empirical orthogonal functions (eofs) via the correlation matrix (data) and returns a 2D float array dimensioned neval x num_stations.

Both of these functions return the following attributes:

trace (scalar, float)
trace of the variance-covariance matrix

eval (1D float array of length neval)
eigenvalues in descending order

pcvar (1D float array of length neval)
percent variance associated with each eigenvalue

Both eofcov and eofcor will ignore missing values if data@_FillValue is set. It is assumed that all stations (grid points) have at least some data present. This is the user's responsibility. if data@_FillValue is set, then the return array will have the same attribute set to this value.

eofcor_ts computes the time series of eof amplitudes for each eigenvalue returned by eofcor and returns a 2D float array dimensioned neval x time. eofcov_ts computes the time series of eof amplitudes for each eigenvalue returned by eofcov and returns a 2D float array dimensioned neval x time.


Example

begin
;
; Parameters
;
  ncol   = 7                      ; # columns (stations or grid points)
  ntime  = 25                     ; # time steps   
 
;
; Read the ASCII file.
;                                 ; open "data " as 2-dim array
  data = asciiread ("data",(/ntime,ncol/), "float")
;
; Eof routines want "time" to be fastest varying dimension.
;
  data!0 = "time"
  data!1 = "ncol"

  neval    = 3
  evecv    = eofcov    (data(ncol | :,time | :),neval)
  evecv_ts = eofcov_ts (data(ncol | :,time | :),evecv)

  print ("evecv@trace= " + evecv@trace)
  print ("evecv@pcvar= " + evecv@pcvar)
;
; here is another way to do the calls
;
  data2    = data(ncol | :,time | :) 
  evecr    = eofcor    (data2,neval)
  evecr_ts = eofcor_ts (data2,evecr)

  print ("evecr@trace= " + evecr@trace)
  print ("evecr@pcvar= " + evecr@pcvar)
end

Reference Manual Control Panel

NG4.1 Home, Index, Examples, Glossary, Feedback, Ref Contents, Ref WhereAmI?


$Revision: 1.8 $ $Date: 1999/02/03 18:12:54 $