TARMA.fit2: TARMA Modelling of Time Series

View source: R/TARMA.fit2.R

TARMA.fit2R Documentation

TARMA Modelling of Time Series

Description

\loadmathjax

Maximum Likelihood fit of a two-regime TARMA(p1,p2,q,q) model with common MA parameters, possible common AR parameters and possible covariates.

Usage

TARMA.fit2(
  x,
  ar.lags = NULL,
  tar1.lags = c(1),
  tar2.lags = c(1),
  ma.ord = 1,
  sma.ord = 0L,
  period = NA,
  threshold = NULL,
  d = 1,
  pa = 0.25,
  pb = 0.75,
  thd.var = NULL,
  include.int = TRUE,
  x.reg = NULL,
  optim.control = list(),
  ...
)

Arguments

x

A univariate time series.

ar.lags

Vector of common AR lags. Defaults to NULL. It can be a subset of lags.

tar1.lags

Vector of AR lags for the lower regime. It can be a subset of 1 ... p1 = max(tar1.lags).

tar2.lags

Vector of AR lags for the upper regime. It can be a subset of 1 ... p2 = max(tar2.lags).

ma.ord

Order of the MA part (also called q below).

sma.ord

Order of the seasonal MA part (also called Q below).

period

Period of the seasonal MA part (also called s below).

threshold

Threshold parameter. If NULL estimates the threshold over the threshold range specified by pa and pb.

d

Delay parameter. Defaults to 1.

pa

Real number in [0,1]. Sets the lower limit for the threshold search to the 100*pa-th sample percentile. The default is 0.25

pb

Real number in [0,1]. Sets the upper limit for the threshold search to the 100*pb-th sample percentile. The default is 0.75

thd.var

Optional exogenous threshold variable. If NULL it is set to lag(x,-d). If not NULL it has to be a ts object.

include.int

Logical. If TRUE includes the intercept terms in both regimes, a common intercept is included otherwise.

x.reg

Covariates to be included in the model. These are passed to arima. If they are not ts objects they must have the same length as x.

optim.control

List of control parameters for the optimization method.

...

Additional arguments passed to arima.

Details

Fits the following two-regime TARMA process with optional components: linear AR part, seasonal MA and covariates.
\mjdeqnX_t = \phi_0 + \sum_h \in I \phi_h X_t-h + \sum_l=1^Q \Theta_l \epsilon_t-ls + \sum_j=1^q \theta_j \epsilon_t-j + \sum_k=1^K \delta_k Z_k + \epsilon_t + \left\lbrace \beginarrayll \phi_1,0 + \sum_i \in I_1 \phi_1,i X_t-i & \mathrmif X_t-d \leq \mathrmthd \\\ &\\\ \phi_2,0 + \sum_i \in I_2 \phi_2,i X_t-i & \mathrmif X_t-d > \mathrmthd \endarray \right. X[t] = \phi[0] + \Sigma_h in I \phi[h] X[t-h] + \Sigma_j = 1,..,q \theta[j] \epsilon[t-j] + \Sigma_j = 1,..,Q \Theta[j] \epsilon[t-js] + \Sigma_k = 1,..,K \delta[k] Z[k] + \epsilon[t] + + \phi[1,0] + \Sigma_i in I_1 \phi[1,i] X[t-i] – if X[t-d] <= thd + \phi[2,0] + \Sigma_i in I_2 \phi[2,i] X[t-i] – if X[t-d] > thd

where \mjeqn\phi_h\phi[h] are the common AR parameters and \mjseqnh ranges in I = ar.lags. \mjeqn\theta_j\theta[j] are the common MA parameters and \mjeqnj = 1,...,qj = 1,...,q (q = ma.ord), \mjeqn\Theta_l\Theta[l] are the common seasonal MA parameters and \mjeqnl = 1,...,Ql = 1,...,Q (Q = sma.ord) \mjeqn\delta_k\delta[k] are the parameters for the covariates. Finally, \mjeqn\phi_1,i\phi[1,i] and \mjeqn\phi_2,i\phi[2,i] are the TAR parameters for the lower and upper regime, respectively and I1 = tar1.lags I2 = tar2.lags are the vector of TAR lags.

Value

A list of class TARMA with components:

  • fit - The output of the fit. It is a arima object.

  • aic - Value of the AIC for the minimised least squares criterion over the threshold range.

  • bic - Value of the BIC for the minimised least squares criterion over the threshold range.

  • aic.v - Vector of values of the AIC over the threshold range.

  • thd.range - Vector of values of the threshold range.

  • d - Delay parameter.

  • thd - Estimated threshold.

  • phi1 - Estimated AR parameters for the lower regime.

  • phi2 - Estimated AR parameters for the upper regime.

  • theta1 - Estimated MA parameters for the lower regime.

  • theta2 - Estimated MA parameters for the upper regime.

  • delta - Estimated parameters for the covariates x.reg.

  • tlag1 - TAR lags for the lower regime

  • tlag2 - TAR lags for the upper regime

  • mlag1 - TMA lags for the lower regime

  • mlag2 - TMA lags for the upper regime

  • arlag - Same as the input slot ar.lags

  • include.int - Same as the input slot include.int

  • se - Standard errors for the parameters. Note that they are computed conditionally upon the threshold so that they are generally smaller than the true ones.

  • rss - Minimised residual sum of squares.

  • method - Estimation method.

  • call - The matched call.

Author(s)

Simone Giannerini, simone.giannerini@uniud.it

Greta Goracci, greta.goracci@unibz.it

References

  • \insertRef

    Gia21tseriesTARMA

  • \insertRef

    Cha19tseriesTARMA

See Also

TARMA.fit for Least Square estimation of full subset TARMA models. print.TARMA for print methods for TARMA fits. predict.TARMA for prediction and forecasting.

Examples

## a TARMA(1,1,1,1)
set.seed(127)
x    <- TARMA.sim(n=100, phi1=c(0.5,-0.5), phi2=c(0,0.8), theta1=0.5, theta2=0.5, d=1, thd=0.2)
fit1 <- TARMA.fit2(x, tar1.lags=1, tar2.lags=1, ma.ord=1, d=1)


## Showcase of the fit with covariates ---
## simulates from a TARMA(3,3,1,1) model with common MA parameter
## and common AR(1) and AR(2) parameters. Only the lag 3 parameter varies across regimes
set.seed(212)
n <- 300
x <- TARMA.sim(n=n, phi1=c(0.5,0.3,0.2,0.4), phi2=c(0.5,0.3,0.2,-0.2), theta1=0.4, theta2=0.4,
     d=1, thd=0.2, s1=1, s2=1)

## FIT 1: estimates lags 1,2,3 as threshold lags ---
fit1 <- TARMA.fit2(x, ma.ord=1, tar1.lags=c(1,2,3), tar2.lags=c(1,2,3), d=1)

## FIT 2: estimates lags 1 and 2 as fixed AR and lag 3 as the threshold lag
fit2 <- TARMA.fit2(x, ma.ord=1, tar1.lags=c(3),  tar2.lags=c(3), ar.lags=c(1,2), d=1)

## FIT 3: creates lag 1 and 2 and fits them as covariates ---
z1   <- lag(x,-1)
z2   <- lag(x,-2)
fit3 <- TARMA.fit2(x, ma.ord=1,  tar1.lags=c(3), tar2.lags=c(3), x.reg=ts.intersect(z1,z2), d=1)

## FIT 4: estimates lag 1 as a covariate, lag 2 as fixed AR and lag 3 as the threshold lag
fit4 <- TARMA.fit2(x, ma.ord = 1,  tar1.lags=c(3), tar2.lags=c(3), x.reg=z1, ar.lags=2, d=1)



tseriesTARMA documentation built on Oct. 8, 2024, 5:11 p.m.