debias: Calibration of Daily Time Series

View source: R/debias.R

debiasR Documentation

Calibration of Daily Time Series

Description

Applies bias correction derived from forecast and observation data to forecast data set

Usage

debias(
  fcst,
  obs,
  method = "unbias",
  fcst.out = fcst,
  fc.time = NULL,
  fcout.time = fc.time,
  strategy = "none",
  ...
)

Arguments

fcst

n x m x k array of n lead times, m forecasts, of k ensemble members

obs

n x m matrix of veryfing observations

method

character string with bias correction method name

fcst.out

array of forecast values to which bias correction should be applied (defaults to fcst)

fc.time

forecast dates of class 'Date' (for monthly correction, see monthly)

fcout.time

forecast dates of class 'Date' (for monthly correction, see monthly)

strategy

keyword for out-of-sample strategy (defaults to "none", i.e. all values in obs/fcst are used to debias fcst.out), named list of parameters, or list of indices of obs/fcst pairs to be used for each instance in fcst.out (see indRef).

...

additional arguments passed to bias correction methods

Details

No missing values are tolerated in either 'obs' or 'fcst' to ensure consistency of calibration. Missing ensemble members, however, are tolerated in 'fcst.out', thereby allowing calibration of non-homogeneous ensembles.

Examples

## initialise forcast observation pairs
fcst <- array(rnorm(30*215*51, mean=1, sd=rep(seq(0.5,2, length=30), each=215)), 
c(215, 30, 51)) + 0.5*sin(seq(0,4,length=215))
obs <- array(rnorm(30*215, mean=2), c(215, 30)) + sin(seq(0,4, length=215))
fcst.debias <- debias(fcst, obs, 'unbias')
## should be exactly zero
range(rowMeans(obs, dims=1) - rowMeans(fcst.debias, dims=1))


jonasbhend/biascorrection documentation built on Nov. 11, 2023, 1:16 a.m.