rolling {ConsReg}R Documentation

rolling: Back-test your model

Description

Function for creating rolling density forecast from ConsRegArima models with option for refitting every n periods.

Usage

rolling(object, used.sample, refit, h = 1, orig.data, ...)

Arguments

object

ConsRegArima object

used.sample

The starting point in the dataset from which to initialize the rolling forecast.

refit

Determines every how many periods the model is re-estimated. If refit=0, then no refit is doing

h

The number of periods to forecast

orig.data

data original which was used to estimate the ConsRegArima object

...

Additional params for predict function

Value

results

data.frame with Real, Prediction, Prediction_High, Prediction_Low and fitted values of the object

refitT

how many periods the model is re-estimated

metrics

Main metrics of the predictions

See Also

plot.roll.ConsRegArima

Examples

data('series')
fit1 = ConsRegArima(formula = y ~ x1+x2 +x3, order = c(2, 1),
                    optimizer = 'solnp', data = series)
roll = rolling(fit1, used.sample = 40,
               refit = 5, orig.data = series, h=3)
roll
plot(roll)


[Package ConsReg version 0.1.0 Index]