prepareData | R Documentation |
Configuration of data for flexible downscaling experiment definition
prepareData(
x,
y,
global.vars = NULL,
combined.only = TRUE,
spatial.predictors = NULL,
local.predictors = NULL,
extended.predictors = NULL
)
x |
A grid (usually a multigrid) of predictor fields |
y |
A grid (usually a stations grid, but not necessarily) of observations (predictands) |
global.vars |
An optional character vector with the short names of the variables of the input |
combined.only |
Optional, and only used if spatial.predictors parameters are passed. Should the combined PC be used as the only
global predictor? Default to TRUE. Otherwise, the combined PC constructed with |
spatial.predictors |
Default to |
local.predictors |
Default to
|
extended.predictors |
This is a parameter related to the extreme learning machine and reservoir computing framework where input data is randomly projected into a new space of size
|
Temporal consistency
Note that x
(predictors) and y
predictands are checked for temporal consistency
prior to downscaling. In case of partial temporal overlapping, both are internnaly intersected for exact temporal matching.
Principal Component Analysis
Always that spatial.predictors is used, a combined PC will be returned (unless one single predictor is used, case in which no combination is possible).
Note that the variables of the predictor grid used to construct the combined PC can be flexibly controlled through the optional argument
subset.vars
.
A named list with components y
(the predictand), x.global
(global predictors, 2D matrix), x.local
(local predictors, a list)
and pca
(prinComp
output), and other attributes. See Examples.
J. Bedia, D. San-Martín and J.M. Gutiérrez
downscaleR Wiki for preparing predictors for downscaling and seasonal forecasting.
Other downscaling.helpers:
predictor.nn.indices()
,
predictor.nn.values()
,
prepareNewData()
require(transformeR)
# Loading data
require(climate4R.datasets)
data("VALUE_Iberia_tas")
y <- VALUE_Iberia_tas
data("NCEP_Iberia_hus850", "NCEP_Iberia_psl", "NCEP_Iberia_ta850")
x <- makeMultiGrid(NCEP_Iberia_hus850, NCEP_Iberia_psl, NCEP_Iberia_ta850)
# Raw data
data <- prepareData(x = x, y = y)
# Using PCs as predictors. Number of EOFS: 10,5,5 for the 3 input variables
data <- prepareData(x = x, y = y, spatial.predictors = list(n.eofs = c(10,5,5)))
# Using joined PCs as predictors. Explained variance 95%
data <- prepareData(x = x, y = y,
spatial.predictors = list(v.exp = 0.95, which.combine =getVarNames(x)))
# Using local predictors: the 4 closest gridboxes
data <- prepareData(x = x, y = y,local.predictors = list(n=4, vars = getVarNames(x)))
# Using joined PCs and local predictors: the 4 closest gridboxes
data <- prepareData(x = x, y = y,local.predictors = list(n=4, vars = getVarNames(x)),
spatial.predictors = list(v.exp = 0.95, which.combine =getVarNames(x)))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.