View source: R/corrMat.VALUE.R
corrMat.VALUE | R Documentation |
Computes the cross correlation matrices between stations that serve as input for plotting functions
corrMat.VALUE(
stationObj,
predictionObj = NULL,
season = c("annual", "DJF", "MAM", "JJA", "SON"),
method = "pearson",
type = "after",
max.na.prop = 0.25,
deseason = TRUE,
window.width = 31
)
stationObj |
An R-VALUE object containing station data (as returned by |
predictionObj |
A R-VALUE predictions object as loaded by |
season |
Character string indicating the target season. Accepted values are
|
method |
Correlation method, passed to the |
type |
Type of aggregation in the case of multiple realizations. Should the aggregation of
multiple members be performed |
max.na.prop |
Maximum allowed proportion of missing data (Default to 0.25). See details |
deseason |
Logical. Should the seasonal cycle from the input data series be removed?. See details. |
window.width |
Used if |
Seasonal cycle removal
A (circular) moving average daily climatology can be automatically calculated for each data series, considering
a specific window width (31 days by default, centered around lag 0). This is used for removing the seasonal cycle.
Alternatively, the predictionObj
or stationObj
can be passed to the function adter applying deseason.VALUE
.
Missing data treatment
An additional argument, max.na.prop
, allows to specify the maximum number of missing values allowed, being ommited from the analysis
those data series above the threshold. Note that this argument is applied on a seasonal basis, so correlation
matrices for different seasons may differ in their dimension. Missing ata filering can be disabled by setting
the maximum allowed proportion of missing data to 1.
A list of 2D matrices. The length of the list corresponds to the periods indicated in the season
argument (default to 5,
annual and the four standard WMO seasons). Matrix attributes indicate -in the row/column order they appear- the station names, id codes,
and their geographical coordinates. Global attributes provide other method details.
J. Bedia
## Not run:
obs.file <- file.path(find.package("VALUE"),"example_datasets","VALUE_ECA_86_v2.zip")
stationObj <- loadValueStations(obs.file, "precip")
predictions.file <- file.path(find.package("VALUE"),"example_datasets",
"example_predictions_precip_portal_exp1a_deterministic.zip")
prd <- loadStationPredictions(stationObj, predictions.file)
# Correlation matrix of annual data:
annual <- corrMat.VALUE(stationObj, prd, season = "annual")
# Correlation matrix for winter and summer:
djfjja <- corrMat.VALUE(stationObj, prd, season = c("DJF","JJA"))
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.