Learn R Programming

fable (version 0.5.0)

ARFIMA: Estimate an ARFIMA model

Description

Searches through the model space specified in the specials to identify a suitable ARFIMA model. ARFIMA (AutoRegressive Fractionally Integrated Moving Average) models extend ARIMA models by allowing fractional differencing, which is useful for modeling long memory processes. The model is implemented using fracdiff::fracdiff() and allows ARFIMA models to be used in the fable framework.

Usage

ARFIMA(
  formula,
  ic = c("aicc", "aic", "bic"),
  selection_metric = function(x) x[[ic]],
  stepwise = TRUE,
  greedy = TRUE,
  order_constraint = p + q 

Value

A model specification.

Arguments

formula

Model specification (see "Specials" section).

ic

The information criterion used in selecting the model.

selection_metric

A function used to compute a metric from the fitted object which is minimised to select the best model.

stepwise, greedy, order_constraint, trace

Arguments kept for API compatibility with ARIMA(). Currently not fully implemented for ARFIMA.

...

Further arguments passed to fracdiff::fracdiff().

Parameterisation

An ARFIMA(p,d,q) model is defined as:

$$(1-\phi_1B - \cdots - \phi_p B^p)(1-B)^d (y_t - \mu) = (1 + \theta_1 B + \cdots + \theta_q B^q)\varepsilon_t$$

where \(\mu\) is the mean of the series, and \(d\) can take fractional values (typically between -0.5 and 0.5), allowing the model to capture long memory behavior. When \(d\) is an integer, the model reduces to a standard ARIMA model.

Note: This uses a mean form parameterisation where the data is de-meaned before fitting. This differs from ARIMA() which uses a constant form parameterisation.

The fractional differencing operator \((1-B)^d\) is computed using the fast algorithm of Jensen and Nielsen (2014), which is implemented in the fracdiff package.

Specials

The specials define the space over which ARFIMA will search for the model that best fits the data. If the RHS of formula is left blank, the default search space is given by pdq(): a model with candidate non-seasonal terms and fractional differencing, but no exogenous regressors.

Note that ARFIMA does not support seasonal differencing (PDQ terms). For seasonal data, consider using ARIMA() instead, or pre-process your data to remove seasonality.

pdq

The pdq special is used to specify the components of the ARFIMA model.


pdq(p = 0:5, d = NULL, q = 0:5, 
    d_range = c(0, 0.5),
    p_init = 2, q_init = 2, fixed = list())

pThe order of the auto-regressive (AR) terms. If multiple values are provided, the one which minimises ic will be chosen.
dThe fractional differencing parameter. If NULL (default), it will be estimated. If a single numeric value is provided, it will be held fixed at that value. Unlike ARIMA, only a single value or NULL is allowed.
qThe order of the moving average (MA) terms. If multiple values are provided, the one which minimises ic will be chosen.
d_rangeA numeric vector of length 2 specifying the range for estimating d. Only used when d = NULL. Typical values are between -0.5 and 0.5.
p_initIf stepwise = TRUE, p_init provides the initial value for p for the stepwise search procedure.
q_initIf stepwise = TRUE, q_init provides the initial value for q for the stepwise search procedure.
fixedA named list of fixed parameters for coefficients. The names identify the coefficient, beginning with either ar or ma, followed by the lag order. For example, fixed = list(ar1 = 0.3, ma2 = 0).

xreg

Exogenous regressors can be included in an ARFIMA model without explicitly using the xreg() special. Common exogenous regressor specials as specified in common_xregs can also be used. These regressors are handled using stats::model.frame(), and so interactions and other functionality behaves similarly to stats::lm().

The inclusion of a constant in the model follows similar rules to stats::lm(), where including 1 will add a constant and 0 or -1 will remove the constant. If left out, the inclusion of a constant will be determined by minimising ic.


xreg(..., fixed = list())

...Bare expressions for the exogenous regressors (such as log(x))
fixedA named list of fixed parameters for coefficients. The names identify the coefficient, and should match the name of the regressor. For example, fixed = list(constant = 20).

References

Jensen, A. N. and Nielsen, M. Ø. (2014) A Fast Fractional Difference Algorithm. Journal of Time Series Analysis 35(5), 428–436. tools:::Rd_expr_doi("10.1111/jtsa.12074")

See Also

ARIMA() for standard ARIMA models with integer differencing.

Forecasting: Principles and Practices, ARIMA models (chapter 9)

fracdiff::fracdiff() for the underlying fitting function.

Examples

Run this code
if (FALSE) { # requireNamespace("fracdiff", quietly = TRUE)
library(tsibble)
library(dplyr)

# Automatic ARFIMA specification
as_tsibble(sunspot.year) %>%
 model(arfima = ARFIMA(value)) %>%
 report()
 
# Manual ARFIMA specification with fixed d
as_tsibble(sunspot.year) %>%
  model(arfima = ARFIMA(value ~ pdq(p = 1, d = 0.3, q = 1))) %>%
  report()
}

Run the code above in your browser using DataLab