Learn R Programming

s2dverification (version 2.10.3)

EOF: Area-Weighted Empirical Orthogonal Function Analysis Using SVD

Description

Performs an area-weighted EOF analysis using SVD based on a covariance matrix by default, based on the correlation matrix if corr argument is set to TRUE.

Usage

EOF(ano, lon, lat, neofs = 15, corr = FALSE)

Arguments

ano

Array of anomalies with dimensions (number of timesteps, number of latitudes, number of longitudes). NAs could exist but it should be consistent along time_dim. That is, if one grid point has NAs, all the time steps at this point should be NAs.

lon

Vector of longitudes of ano.

lat

Vector of latitudes of ano.

neofs

Number of modes to be kept. Default = 15.

corr

Whether to base on a correlation matrix (TRUE) or on a covariance matrix (default, FALSE).

Value

EOFs

An array of EOF patterns normalized to 1 (unitless) with dimensions (number of modes, number of latitudes, number of longitues). Multiplying EOFs by PCs gives the original reconstructed field.

PCs

An array of pincipal components with the units of the original field to the power of 2, with dimensions (number of time steps, number of modes). PCs contains already the percentage of explained variance so, to reconstruct the original field it's only needed to multiply EOFs by PCs.

var

Percentage ( mode (number of modes).

mask

Mask with dimensions (number of latitudes, number of longitudes).

wght

Weights with dimensions (number of latitudes, number of longitudes).

See Also

ProjectField, NAO, PlotBoxWhisker

Examples

Run this code
# NOT RUN {
# See examples on Load() to understand the first lines in this example
 
# }
# NOT RUN {
data_path <- system.file('sample_data', package = 's2dverification')
expA <- list(name = 'experiment', path = file.path(data_path, 
            'model/$EXP_NAME$/$STORE_FREQ$_mean/$VAR_NAME$_3hourly',
            '$VAR_NAME$_$START_DATE$.nc'))
obsX <- list(name = 'observation', path = file.path(data_path, 
            '$OBS_NAME$/$STORE_FREQ$_mean/$VAR_NAME$',
            '$VAR_NAME$_$YEAR$$MONTH$.nc'))

# Now we are ready to use Load().
startDates <- c('19851101', '19901101', '19951101', '20001101', '20051101')
sampleData <- Load('tos', list(expA), list(obsX), startDates,
                  leadtimemin = 1, leadtimemax = 4, output = 'lonlat',
                  latmin = 27, latmax = 48, lonmin = -12, lonmax = 40)
 
# }
# NOT RUN {
 
# }
# NOT RUN {
# This example computes the EOFs along forecast horizons and plots the one that 
# explains the greatest amount of variability. The example data is very low 
# resolution so it does not make a lot of sense.
ano <- Ano_CrossValid(sampleData$mod, sampleData$obs)
eof <- EOF(Mean1Dim(ano$ano_exp, 2)[1, , 1, , ], sampleData$lon, sampleData$lat)
PlotEquiMap(eof$EOFs[1, , ], sampleData$lon, sampleData$lat)

# }

Run the code above in your browser using DataLab