Obtain scalar forecast from random forest (ranger) model

ranger_2_scalar_forecast(model, h = 1, target = "value", model_sample)

Arguments

model

estimated ranger model

h

forecasting horizon

target

name of the target variable

model_sample

non-augmented data set for model estimation

Value

scalar forecast for given h

Details

Obtain scalar forecast from random forest (ranger) 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 = ranger_fun(test_tsibble, h = 1) ranger_2_scalar_forecast(model, h = 1, model_sample = test_tsibble)
#> [1] 0.08930897