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.84619673 8.09575755 0.76349282 4.35076534 0.08343497 1.50824507
#>  [7] 1.49217859 1.16047615 1.64556724 0.49265178
adj_fn(y)
#>  [1]  1.269295 24.287273  4.199210 39.156888  1.126372 28.656656 38.050554
#>  [8] 38.295713 68.291040 25.125241