Skip to contents

Mirrors morie.fn.joholt. With damped = TRUE the trend contribution is \(\sum_{i\le h}\phi^i\) rather than h, so long horizons flatten instead of extrapolating a line forever.

Usage

morie_holt_linear(
  y,
  alpha = NULL,
  beta = NULL,
  horizon = 1L,
  damped = FALSE,
  phi = 0.98
)

Arguments

y

numeric series, at least 5 observations.

alpha, beta

smoothing parameters in (0, 1); estimated by one-step SSE when NULL.

horizon

forecast horizon.

damped

logical; damp the trend.

phi

damping parameter in (0, 1].

Value

list: forecast, level, trend, fitted, residuals, sse, alpha, beta, damped, n.

References

Hyndman, R. J. & Athanasopoulos, G. (2021). Forecasting: Principles and Practice (3rd ed.). OTexts. Sec. 8.2.

Examples

morie_holt_linear(1:30 * 2, horizon = 3)$forecast
#> [1] 62 64 66