smooth_scale: Smoothed Mean De-biasing With Variance Scaling

View source: R/smooth_scale.R

smooth_scaleR Documentation

Smoothed Mean De-biasing With Variance Scaling

Description

Computes mean de-biasing with loess smoothing and adjusts variance. smooth_scale scales the ensemble deviations from the climatology, whereas smooth_scalespread only scales the ensemble anomalies (change to the ensemble spread).

Usage

smooth_scale(fcst, obs, fcst.out = fcst, span = min(1, 31/nrow(fcst)), ...)

smooth_scalespread(
  fcst,
  obs,
  fcst.out = fcst,
  span = min(1, 31/nrow(fcst)),
  ...
)

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

fcst.out

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

span

the parameter which controls the degree of smoothing (see loess)

...

additional arguments for compatibility with other bias correction methods

Details

The standard deviation (1/n definition) of the observations and simulations is computed against the smoothed climatology in order to get consistent results should the forecast ensemble collapse on the observations. The disadvantage of this approach is the dependence of the scaling on the climatological fit.

Examples

## initialise forcast observation pairs
fcst <- array(rnorm(215*30*51, mean=3, sd=0.2), c(215, 30, 51)) + 
0.5*sin(seq(0,4,length=215))
obs <- array(rnorm(215*30, mean=2), c(215, 30)) + 
sin(seq(0,4, length=215))
fcst.debias <- biascorrection:::smooth_scale(fcst[,1:20,], obs[,1:20], fcst.out=fcst, span=0.5)


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