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.
ARFIMA(
formula,
ic = c("aicc", "aic", "bic"),
selection_metric = function(x) x[[ic]],
stepwise = TRUE,
greedy = TRUE,
order_constraint = p + q A model specification.
Model specification (see "Specials" section).
The information criterion used in selecting the model.
A function used to compute a metric from the fitted object which is minimised to select the best model.
Arguments kept for API
compatibility with ARIMA(). Currently not fully implemented for ARFIMA.
Further arguments passed to fracdiff::fracdiff().
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.
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.
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())
p | The order of the auto-regressive (AR) terms. If multiple values are provided, the one which minimises ic will be chosen. |
d | The 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. |
q | The order of the moving average (MA) terms. If multiple values are provided, the one which minimises ic will be chosen. |
d_range | A 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_init | If stepwise = TRUE, p_init provides the initial value for p for the stepwise search procedure. |
q_init | If stepwise = TRUE, q_init provides the initial value for q for the stepwise search procedure. |
fixed | A 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). |
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)) |
fixed | A 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). |
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")
ARIMA() for standard ARIMA models with integer differencing.
Forecasting: Principles and Practices, ARIMA models (chapter 9)
fracdiff::fracdiff() for the underlying fitting function.
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