farima: Out-of-Sample Forecasts based on ARIMA

Description Usage Arguments Author(s) Examples

View source: R/farima.R

Description

This function makes one-step-ahead forecasts for an ARIMA model with either a fixed, recrusive, or rolling window.

Usage

1
2
3
4
5
farima(data=NULL, window=c("recursive", "rolling", "fixed"),
        w_size=NULL, y.index=1L, order=c(0,0,0), seasonal=c(0,0,0),
        frequency=7, include.mean=T, include.drift=F,
        include.constant=F, lambda=model$lambda, model=NULL,
        biasadj=F, method="CSS")

Arguments

data

a data frame, numeric matrix, numeric vector, univariate or multivaraite zoo/ts object.

window

character, indicating the forecasting scheme to be applied. Options include "recursive", "rolling", and "fixed".

w_size

numeric, indicating the index where the forecasting should begin. If the first point forecast should be made at the 73th observation, for example, w_size should be set to be 72.

frequency

the frequency of the observations. This is useful for the seasonal ARIMA component. Default is 7 (daily).

y.index

an integer indicating the index of the response variable. Ignored for univariate time series data or a signle numeric vector. If a multi-column data frame, matrix, or multivariaate time series is provided for data, the rest of the variables are considered as the x regressors.

order

the non-seasonal part of the ARIMA model: the three components (p, d, q) are the AR order, the degree of differencing, and the MA order.

seasonal

the seasonal part of the ARIMA model, plus the period (which defaults to frequency(y)). This should be a list with components order and period, but a specification of just a numeric vector of length 3 will be turned into a suitable list with the specification as the order.

include.mean

logical, indicating whether the ARIMA model should include a mean term. The default is TRUE.

include.drift

logical, indicating whether the ARIMA model should include a linear drift term. The default is FALSE.

include.constant

If TRUE, then include.mean is set to be TRUE for undifferenced series and include.drift is set to be TRUE for differenced series.

lambda

Box-Cox transformation parameter. If lambda="auto", then a transformation is automatically selected using BoxCox.lambda. The transformation is ignored if NULL. Otherwise, data transformed before model is estimated.

biasadj

Use adjusted back-transformed mean for Box-Cox transformations. If transformed data is used to produce forecasts and fitted values, a regular back transformation will result in median forecasts. If biasadj is TRUE, an adjustment will be made to produce mean forecasts and fitted values.

method

Fitting method: maximum likelihood or minimize conditional sum-of-squares. The default (unless there are missing values) is to use conditional-sum-of-squares to find starting values, then maximum likelihood.

model

Output from a previous call to Arima. If model is passed, this same model is fitted to y without re-estimating any parameters.

Author(s)

Zehua Wu

Examples

1
2
3
4
##Example using simulated series

data<-arima.sim(model=list(ar=c(0.9, -0.2)), n=200)
farima(data=data, test=testData, window="recursive", w_size=150)

ZehuaWu/farima documentation built on May 29, 2019, 12:01 a.m.