
Trim a forecast to a maximum prediction-interval width
Source:R/ts_forecast.R
morie_ts_trim_forecast.RdTruncates a forecast at the first horizon whose prediction-interval
width exceeds max_width, giving an explicit mechanism to bound
forecasts by a specified error margin.
Examples
m <- morie_ts_arima(cumsum(rnorm(80)), order = c(1, 1, 0))
fc <- morie_ts_forecast(m, h = 30)
morie_ts_trim_forecast(fc, max_width = 5)$h
#> [1] 1