rolling: rolling: Back-test your model

Description Usage Arguments Value See Also Examples

View source: R/roll_ConsRegArima.R

Description

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

Usage

1
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

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

ConsReg documentation built on April 5, 2020, 5:06 p.m.