predCap: Forecasting Performance in ARIMA Models

View source: R/compare_forecast.R

predCapR Documentation

Forecasting Performance in ARIMA Models

Description

Performs more complete analysis of the forecasting performance of an ARIMA model by fitting the model with a train set with h less points and then use those h points as a test set.

Usage

predCap(object, h = 10, model, dates, plot = T)

Arguments

object

a time series object or a matrix containing the time series values.

h

number of points that will not be used to fit the model, but to use as testing. The points will be taken from the bottom.

model

an object describing a time series model; e.g. of class CArima.

dates

a vector or an array with the dates as character of each observation of the time series. This vector can be generated using the function dateSeq.

plot

if TRUE, it will show all the plots in execution.

Value

A list containing at least the following components:

forecasts

The forecasts of the h points extracted from the original data object, with their confidence intervals as a data.frame.

SSEtable

A data.frame containing the fitted values, real values, residual values and SSE values of the h points extracted from the original data object.

forecPlot

A plot of the forecasts values and the confidence intervals calculated.

bandWidth

The width of the forecasts confidence intervals.

bandWidthPlot

A plot of the forecasts confidence bands width.

See Also

ggplot.

Examples

#Easy example with AirPassengers
dates <- dateSeq(from = time(AirPassengers)[1], length.out = length(AirPassengers),
                 by = "month")
model <- CArima(as.vector(log(AirPassengers)), order = c(0, 1, 1), 
                seasonal = list(order=c(0,1,1), period = 12))
model

predCapModel <- predCap(as.vector(log(AirPassengers)), h = 12, model, dates, 
                        plot = F) 
predCapModel

danipequelangos/CBJTSA documentation built on Oct. 16, 2022, 7:19 p.m.