Obtain scalar forecast from lasso model

lasso_2_scalar_forecast(
  model,
  h = 1,
  target = "value",
  model_sample,
  s = c("lambda.min", "lambda.1se")
)

Arguments

model

estimated lasso model

h

forecasting horizon

target

name of the target variable

model_sample

non-augmented data set for model estimation

s

criterion to select best regularization lambda in lasso

Value

scalar forecast for given h

Details

Obtain scalar forecast from lasso model. The function automatically augments data with lags, fourier terms, trend etc.

Examples

test_ts = stats::ts(rnorm(100), start = c(2000, 1), freq = 12) test_tsibble = tsibble::as_tsibble(test_ts) model = lasso_fun(test_tsibble, h = 1) lasso_2_scalar_forecast(model, h = 1, model_sample = test_tsibble)
#> 1 #> [1,] 0.1157456