Skip to contents

Converts forecasts produced on a transformed scale back to the original scale.

Usage

ts_back_transform(forecast_tbl, params)

Arguments

forecast_tbl

Forecast tibble from ts_forecast().

params

The params element from ts_transform().

Value

The forecast tibble with numeric forecast columns restored.

Examples

x = as_ts_df(AirPassengers)
tr = ts_transform(x, method = "log")
fc = tibble::tibble(step = 1:2, forecast = log(c(500, 600)))
ts_back_transform(fc, tr$params)
#> # A tibble: 2 × 2
#>    step forecast
#>   <int>    <dbl>
#> 1     1      500
#> 2     2      600