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.4926518 2.0161103 1.3106371 0.8837291 0.3126670 1.5142774 0.4004691
#>  [8] 0.7507029 2.1712723 0.6279498
adj_fn(y)
#>  [1]  0.7389777  6.0483308  7.2085039  7.9535616  4.2210045 28.7712704
#>  [7] 10.2119618 24.7731960 90.1078014 32.0254392