Skip to contents

Supervised windowing (y_{t-w+1..t}) -> y_{t+1}, ridge-regularised normal equations (min-norm solve), rolled forward recursively or fit directly per horizon step.

Usage

morie_geron_time_series_forecast(
  y,
  horizon = 1,
  window = 3,
  ridge = 0,
  recursive = TRUE
)

Arguments

y

Univariate series.

horizon

Steps ahead.

window

Lag width.

ridge

L2 penalty (not on intercept).

recursive

Iterate one-step model vs direct per-step fit.

Value

list with forecast, coef, intercept, train_mse, naive_mse, skill, window, horizon, estimate, n, method.

Examples

V <- c(1, 2, 3, 4, 5, 6, 7, 8)
morie_geron_time_series_forecast(V)
#> $forecast
#> [1] 9
#> 
#> $coef
#> [1] -0.3333333  0.3333333  1.0000000
#> 
#> $intercept
#> [1] 0.6666667
#> 
#> $train_mse
#> [1] 1.069695e-28
#> 
#> $naive_mse
#> [1] 1
#> 
#> $skill
#> [1] 1
#> 
#> $window
#> [1] 3
#> 
#> $horizon
#> [1] 1
#> 
#> $estimate
#> [1] 9
#> 
#> $n
#> [1] 8
#> 
#> $method
#> [1] "Recursive lag-window linear forecast (ridge normal equations)"
#>