TARMA.fit2 {tseriesTARMA}R Documentation

TARMA Modelling of Time Series

Description

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,
  estimate.thd = TRUE,
  threshold,
  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).

estimate.thd

Logical. If TRUE estimates the threshold over the threshold range specified by pa and pb.

threshold

Threshold parameter. Used only if estimate.thd = FALSE.

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.
\[X_{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 \begin{array}{ll} \phi_{1,0} + \sum_{i \in I_1} \phi_{1,i} X_{t-i} & \mathrm{if } X_{t-d} \leq \mathrm{thd} \\ &\\ \phi_{2,0} + \sum_{i \in I_2} \phi_{2,i} X_{t-i} & \mathrm{if } X_{t-d} > \mathrm{thd} \end{array} \right. \]

where \(\phi_h\) are the common AR parameters and \(h\) ranges in I = ar.lags. \(\theta_j\) are the common MA parameters and \(j = 1,\dots,q\) (q = ma.ord), \(\Theta_l\) are the common seasonal MA parameters and \(l = 1,\dots,Q\) (Q = sma.ord) \(\delta_k\) are the parameters for the covariates. Finally, \(\phi_{1,i}\) and \(\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:

Author(s)

Simone Giannerini, simone.giannerini@unibo.it

Greta Goracci, greta.goracci@unibz.it

References

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)



[Package tseriesTARMA version 0.3-4 Index]