View source: R/compare_forecast.R
Cforecast | R Documentation |
Largely a wrapper for the forecast
function in the forecast package. It adds some usefull datas and graphs to validate and compare models.
Cforecast( object, h = ifelse(frequency(object) > 1, 2 * frequency(object), 10), level = c(80, 95), fan = FALSE, robust = FALSE, lambda = NULL, biasadj = FALSE, find.frequency = FALSE, allow.multiplicative.trend = FALSE, model = NULL, plot = TRUE, dates, ... )
object |
a time series object or a matrix containing the time series values. |
h |
number of periods for forecasting. |
model |
an object describing a time series model; e.g. of class |
plot |
if |
dates |
a vector or an array with the dates as |
... |
additional arguments to be passed to |
See the forecast
function in the forecast package.
See the forecast
function in the forecast package. The additional objects returned are:
forecasts |
The forecasts with their confidence intervals as a |
realForecPlot |
A real + forecast plot. |
realFitPlot |
A real vs fitted values plot. |
ggplot
#An 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 predModel <- Cforecast(as.vector(log(AirPassengers)), model = model, h = 24, dates = dates, plot = F) predModel summary(predModel)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.