Methods




MCTest

MCTest (
self,
subsamples,
length,
neofs=None,
)
Monte Carlo test for the temporal stability of the EOFs.
Parameters:

subsamples
 Number of Monte Carlo subsamples to take

lenght
 Length of each subsample (obviously less than the total
number od time records)
Optional parameters:

neofs
 Number of EOFs to perform the test on. Defaults to the
number selected by a 70% variance stopping rule (See
pyclimate.tools.getneofs ).
Returns a NumPy array containing in each row the congruence coefficient of
each subsample obtained patterns with those obtained for the whole dataset.


__init__

__init__ ( self, dataset )
Contructor for SVDEOFs
Argument:

dataset
 NumPy array containing the data to be decomposed. Time
must be the first dimension. Several channel dimensions
are supported.


bartlettTest

bartlettTest ( self )
Performs the Bartlett test on the last pk eigenvalues
It is a test on the last pk eigenvalues being the same. It relies
on the statistic:
/ SUM lambda_j \
nu SUM log(lambda_j) + nu(pk) log  
\ p  k /
(SUMmation goes from j=k+1 to p) that is supposed to be distributed
following the chi square distribution with nu=(pk+1)(pk+2)/2 degrees
of freedom.
This method returns a tuple (chi,chiprob) with:

chi
 A NumPy array with the Bartlett statistic for k = 1 to p.
(length: p1)

chiprob
 the probability associated to that
chi value


eigenvalues

eigenvalues ( self )
The decreasing variances associated to each EOF


eofs

eofs ( self, pcscaling=0 )
Returns the empirical orthogonal functions
Optional argument:

pcscaling
 Sets the scaling of the EOFs. Set to 0 for orthonormal
EOFs. Set to 1 for nondimensional EOFs. Defaults to 0.


eofsAsCorrelation

eofsAsCorrelation ( self )
The EOFs scaled as the correlation of the PC with the original field


eofsAsExplainedVariance

eofsAsExplainedVariance ( self )
The EOFs scaled as fraction of explained variance of the original field


northTest

northTest ( self )
Performs the North test returning the estimated sampling errors
Details:
North et al. (1982) Sampling errors in the estimation of empirical
orthogonal functions, Monthly Weather Review 110:699706


pcs

pcs ( self, pcscaling=0 )
Returns the principal components as the columns of an array
Optional argument:

pcscaling
 Sets the scaling of the PCs. Set to 1 for standardized
PCs. Defaults to 0.


projectField

projectField (
self,
neofs,
X=None,
)
Projects a field X onto the neofs leading EOFs returning its coordinates in the EOFspace


reconstructedField

reconstructedField ( self, neofs )
Reconstructs the original field using neofs EOFs


totalAnomalyVariance

totalAnomalyVariance ( self )
The total variance associated to the field of anomalies


unreconstructedField

unreconstructedField (
self,
neofs,
X=None,
)
Returns the part of the field NOT reconstructed by neofs EOFs
Argument:

neofs
 number of EOFs for reconstructing the field
Optional argument:

X
 The field to try to reconstruct. Defaults to the data field
used to derive the EOFs.


varianceFraction

varianceFraction ( self )
The fraction of the total variance explained by each principal mode
