To produce forecast means (instead of forecast medians) it is necessary to adjust the back-transformation function relative to the forecast variance.

bias_adjust(bt, sd)

Arguments

bt

The back-transformation function

sd

The forecast standard deviation

Details

More details about bias adjustment can be found in the transformations vignette: read the vignette: vignette("transformations", package = "fable")

Examples


adj_fn <- bias_adjust(function(x) exp(x), 1:10)
y <- rnorm(10)
exp(y)
#>  [1] 0.24658623 1.29087083 0.08739968 0.99444420 1.86181668 3.15318044
#>  [7] 0.16173151 0.78088663 0.78333126 0.75374177
adj_fn(y)
#>  [1]  0.3698793  3.8726125  0.4806983  8.9499978 25.1345252 59.9104283
#>  [7]  4.1241535 25.7692587 32.5082473 38.4408303