lasso_2_scalar_forecast: Obtain scalar forecast from lasso model

Description Usage Arguments Details Value Examples

View source: R/modelling.R

Description

Obtain scalar forecast from lasso model

Usage

1
2
3
4
5
6
7
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

Details

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

Value

scalar forecast for given h

Examples

1
2
3
4
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)

kassandra-ru/kassandr documentation built on Jan. 1, 2022, 7:39 a.m.