downscaleChunk: Downscaling by chunks

View source: R/downscaleChunk.R

downscaleChunkR Documentation

Downscaling by chunks

Description

Downscale climate data by splitting it in chunks, where there are as many chunks as latitudes. This function encapsulates downscaleTrain

Usage

downscaleChunk(
  x,
  y,
  newdata,
  simulate = FALSE,
  method,
  ...,
  prepareData.args = list(global.vars = NULL, combined.only = TRUE, spatial.predictors
    = NULL, local.predictors = NULL, extended.predictors = NULL),
  condition = NULL,
  threshold = NULL,
  predict = TRUE,
  path = getwd()
)

Arguments

x

The input grid (admits both single and multigrid, see makeMultiGrid). It should be an object as returned by loadeR.

y

The observations dataset. It should be an object as returned by loadeR.

newdata

New datasets where to apply the model infered. It should be a list of objects as returned by loadeR, containing the new dataset/s.

simulate

A logic value indicating whether we want to simulate or not based on the GLM distributional parameters. Only relevant when perdicting with a GLM. Default to FALSE.

method

A string value. Type of transer function. Currently implemented options are "analogs", "GLM" and "NN".

...

Optional parameters. These parameters are different depending on the method selected. Every parameter has a default value set in the atomic functions in case that no selection is wanted. Everything concerning these parameters is explained in the section Details of the function downscaleTrain. However, if wanted, the atomic functions can be seen here: glm.train and nn.train.

prepareData.args

A list with the arguments of the prepareData function. Please refer to prepareData help for more details about this parameter.

condition

Inequality operator to be applied considering the given threshold. "GT" = greater than the value of threshold, "GE" = greater or equal, "LT" = lower than, "LE" = lower or equal than. We only train with the days that satisfy the condition.

threshold

Numeric value. Threshold used as reference for the condition. Default is NULL. If a threshold value is supplied with no specification of the parameter condition. Then condition is set to "GE".

predict

A logic value. Should the prediction on the training set should be returned? Default is TRUE.

path

A string indicating the path where to save the prediction.

Value

Saves the prediction where specified.

Author(s)

J. Bano-Medina

See Also

downscaleTrain for training a downscaling model downscalePredict for prediction for a a test dataset with a trained model for downscaleR Wiki for downscaling seasonal forecasting and climate projections.

Other downscaling.functions: downscaleCV(), downscalePredict(), downscaleTrain(), downscale()


SantanderMetGroup/downscaleR documentation built on July 4, 2023, 4:28 a.m.