View source: R/compare_forecast.R
predCap | R Documentation |
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.
predCap(object, h = 10, model, dates, plot = T)
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 |
dates |
a vector or an array with the dates as |
plot |
if |
A list containing at least the following components:
forecasts |
The forecasts of the |
SSEtable |
A |
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. |
ggplot
.
#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
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.