| Script Name | Description |
EOF
|
Use this function if you can. It works well.
If you need to analyse complex data (with imaginary values) use EOF2.
% function [V,EOFs,EC,error]=EOF(D,p)
%
% This function decomposes a data set D into its EOFs
% and eigenvalues V. The most effecient algorithm proposed by
% von Storch and Hannostock (1984) is used.
%
% D = each row is assumed to be a sample. Each column a variable.
% Thus a column represents a time series of one variable
% p = is an optional parameter indicating the number of
% EOFs the user wants to take into account (smaller than
% the number of time steps and the number of samples).
%
% EOFs= matrix with EOFs in the columns
% V = vector with eigenvalues associated with the EOFs
% EC = EOF Coefficients
% error = the reconstruction error (L2-norm)
%
% This function uses svds from Matlab version 5
%
% Written by Martijn Hooimeijer (1998)
|
EOF2
|
Use this function with complex data. This can be used for vectorized data
where the real part of the data represent the one directions, and the
imagniry part is the component of the vector in the other direction
% function [V,EOFs,EC,error]=EOF2(D,p)
%
% This function decomposes a data set D into its EOFs
% and eigenvalues V. The most effecient algorithm proposed by
% von Storch and Hannostock (1984) is used.
%
% You can use this function with complex data
%
% D = each row is assumed to be a sample. Each column a variable.
% Thus a column represents a time series of one variable
% p = is an optional parameter indicating the number of
% EOFs the user wants to take into account (smaller than
% the number of time steps and the number of samples).
%
% EOFs= matrix with EOFs in the columns
% V = vector with eigenvalues associated with the EOFs
% EC = EOF Coefficients
%
% Written by Martijn Hooimeijer (1998)
|
C_EOF |
Computes Complex EOFs. It first transforms the data to hilbert
space and adds this data as a complex value to the orginal data
% function [V,EOFs,EC,error]=c_eof(D,NOE,options)
%
% This function determines the complex empirical orthogonal functions of a
% data set contained in matrix D.
%
% ******* INPUT PARAMETERS *************
% D = each row is assumed to be a sample. Each column a variable.
% Thus a column represents a time series of one variable
% NOE= required number of eigenvalues. (optional parameter)
% (If no input is given, then all eigenvalues are computed)
% If NOE is 'all' then all eigenvalues are computed.
% options : defined as in matlab function: eigs
%
% ******* OUTPUT PARAMETERS ************
% V = vector of (real) eigenvalues (they are real because the
% covariance matrix is Hermitian)
% EOFs = matrix with complex values. Each columns represents and EOF
% EC = EOF Coefficients, also called Principal Component Coefficients
% Basically the original data transformed to EOF space
% error = compute L2-norm reconstruction error for each spatial point
%
% For the method use in this file see T.P. Barnett, "Interaction of the
% Monsoon and Pacific Trade Wind System at Interannual Time Scales,
% Part I: The Equatorial Zone", Montly Weather Review,
% VOL. 111, page 756-773, (C) 1983 American Meteorological Society.
%
% Also see: J.D. Horel "Complex Principal Component Analysis: Theory and Examples"
% Journal of Climate and Applied Meteorology, V 23, page 1660-1673, 1984
%
% written by Martijn Hooimeijer, 1999 (http://www.martijnhooimeijer.net)
|
E_EOF
| This script computes Extended EOFs (computes the covariance matrix
with a predefined lag.
% function [V,EOFs,EC,error]=E_EOF(D,Lag,p)
%
% This function decomposes a data set D into its extended EOFs
% and eigenvalues V. The most effecient algorith proposed by
% von Storch and Hannostock (1984) is used.
%
% D = each row is assumed to be a sample. Each column a variable.
% Thus a column represents a time series of one variable
% Lag = The lag to be computed. The following covariance matrix will
% be analysed: C=
% p = is an optional parameter indicating the number of
% EOFs the user wants to take into account (smaller than
% the number of time steps and the number of samples).
%
% EOFs= matrix with EOFs in the columns
% V = vector with eigenvalues associated with the EOFs
% EC = EOF Coefficients
%
% written by Martijn Hooimeijer, 1999
|
TCP
| Computes the eigenvalues and eigenvectors of the correlation matrix of
the data. Inspired by the method called TeleConnection Patterns
% function [V,TCPs,TC,error]=TCP(D,p)
%
% This function decomposes a data set D into its Teleconnection
% patterns and eigenvalues V. The most effecient algorithm proposed by
% von Storch and Hannostock (1984) is used.
%
% ******* INPUT PARAMETERS *************
% D = each row is assumed to be a sample. Each column a variable.
% Thus a column represents a time series of one variable
% p = required number of eigenvalues. (optional parameter)
% (If no input is given, then all eigenvalues are computed)
% If NOE is 'all' then all eigenvalues are computed.
% dt= time step of the problem (optional)
% t0= initial time t0 (optional)
%
% ******* OUTPUT PARAMETERS ************
% V = vector of (real) eigenvalues (they are real because the
% covariance matrix is Hermitian)
% TCPs = matrix with each column representing a Teleconnection Pattern
% TC = TCP Coefficients, also called Teleconnection Coefficients
% Basically the original data transformed to Teleconnection space
% error = compute L2-norm reconstruction error for each spatial point
%
% This function uses svds from Matlab version 5
%
%
% written by Martijn Hooimeijer, 1999
|
C_TCP
| Same as TCP but first adds the hilbert transform
of the data to the data as an impaganiry part
|
EOFssa
| perform subspace analysis on two sets of vecors (in my case two sets
of EOFs). The subspace angle is a good indicator of how similar or dissimilar two
vectors/EOFs are. Returns the angle in degrees. It also plots the angle when the vectors
in both sets are compared indivually and when they are compared incrementally.
% function [Angles,Angles2]=EOFssa(A,B);
% This function operates on two orthogonal matrices (each forming a
% subspace of Rn). First the angle between the first colomn of each matrix
% is determined. Then the angle between the two subspaces spanned by the first
% two columns of each matrix and so on. The purpose is to discover to what extent
% the EOFs of different cases span the same space.
% The same computations are carried out for indiviual EOFs. By this it is meant
% that the angle of the two EOFs whith corresonding column numbers in the matrices
% A and B is computed.
% Author: Martijn Hooimeijer
|
ReducedEOF
|
In order to speed up the determination of the EOFs,
this function first filters out those points with a minimum variance (either absolute
or relative). Often data sets contain many points whose variance is negligable
but this still requires a lot of computation time.
function [V,EOFs,EC,error]=ReducedEOF(D, p, minVar, r)
% This function filters out any points with a variance that
% is smaller (in an absolute sense) than the variance minVar.
% Is a fourth optional parameter r is given, then
% a relative size is computed. If minVar = 100, then
% all variancs that are 100 times smaller than the maximum variance
% are filtered out.
% All EOF values for the points with small variance are set as 0.
|
|