ccr_monthly: Daily CCR With Monthly Correction Factors

View source: R/ccr_monthly.R

ccr_monthlyR Documentation

Daily CCR With Monthly Correction Factors

Description

Computes climate conserving recalibration on smoothed monthly means

Usage

ccr_monthly(
  fcst,
  obs,
  fcst.out = fcst,
  fc.time,
  fcout.time = fc.time,
  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)

fc.time

forecast times as R-dates for monthly aggregation

fcout.time

forecast time for array to which bias correction is applied for back compatibility with leave-one-out cross-validation in debias

span

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

...

additional arguments for compatibility with other bias correction methods

Examples

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))
fc.time <- outer(1:215, 1981:2010, function(x,y) as.Date(paste0(y, '-11-01')) - 1 + x)
fcst.debias <- biascorrection:::ccr_monthly(fcst, obs, fc.time=fc.time, span=0.5)
fcst.mon <- monmean(fcst, fc.time)
obs.mon <- monmean(obs, fc.time)
fcst.mondebias <- monmean(fcst.debias, fc.time)


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