pyPDAF.PDAF.eofcovar¶
- pyPDAF.PDAF.eofcovar()¶
EOF analysis of an ensemble of state vectors by singular value decomposition.
Typically, this function is used with
pyPDAF.PDAF.SampleEns()
to generate an ensemble of a chosen size (up to the number of EOFs plus one).Here, the function performs a singular value decomposition of the ensemble anomaly of the input matrix, which is usually an ensemble formed by state vectors at multiple time steps. The singular values and corresponding singular vectors can be used to construct a covariance matrix. This can be used as the initial error covariance for the initial ensemble.
A multivariate scaling can be performed to ensure that all fields in the state vectors have unit variance.
It can be useful to store more EOFs than one finally might want to use to have the flexibility to carry the ensemble size.
See also
- Parameters:
dim (int) – Dimension of state vector
nstates (int) – Number of state vectors
nfields (int) – Number of fields in state vector
dim_fields (ndarray[np.intc, ndim=1]) – Size of each field Array shape: (nfields)
offsets (ndarray[np.intc, ndim=1]) – Start position of each field Array shape: (nfields)
remove_mstate (int) – 1: subtract mean state from states
do_mv (int) – 1: Do multivariate scaling; 0: no scaling
states (ndarray[np.float64, ndim=2]) – State perturbations Array shape: (dim, nstates)
meanstate (ndarray[np.float64, ndim=1]) – Mean state (only changed if remove_mstate=1) Array shape: (dim)
verbose (int) – Verbosity flag
- Returns:
states (ndarray[np.float64, ndim=2]) – State perturbations Array shape: (dim, nstates)
stddev (ndarray[np.float64, ndim=1]) – Standard deviation of field variability Array shape: (nfields)
svals (ndarray[np.float64, ndim=1]) – Singular values divided by sqrt(nstates-1) Array shape: (nstates)
svec (ndarray[np.float64, ndim=2]) – Singular vectors Array shape: (dim, nstates)
meanstate (ndarray[np.float64, ndim=1]) – Mean state (only changed if remove_mstate=1) Array shape: (dim)
status (int) – Status flag