Learn R Programming

tseriesTARMA (version 0.5-2)

TARMA.fit2: 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,
  threshold = NULL,
  d = 1,
  pa = 0.25,
  pb = 0.75,
  thd.var = NULL,
  include.int = TRUE,
  x.reg = NULL,
  optim.control = list(),
  ...
)

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.

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.

Author

Simone Giannerini, simone.giannerini@uniud.it

Greta Goracci, greta.goracci@unibz.it

Details

Fits the following two-regime TARMA process with optional components: linear AR part, seasonal MA and covariates.
X_t = _0 + _h I _h X_t-h + _l=1^Q _l _t-ls + _j=1^q _j _t-j + _k=1^K _k Z_k + _t + arrayll _1,0 + _i I_1 _1,i X_t-i & if X_t-d thd \\\ &\\\ _2,0 + _i I_2 _2,i X_t-i & if X_t-d > thd array . X[t] = [0] + _h in I [h] X[t-h] + _j = 1,..,q [j] [t-j] + _j = 1,..,Q [j] [t-js] + _k = 1,..,K [k] Z[k] + [t] + + [1,0] + _i in I_1 [1,i] X[t-i] -- if X[t-d] <= thd + [2,0] + _i in I_2 [2,i] X[t-i] -- if X[t-d] > thd

where _h[h] are the common AR parameters and h ranges in I = ar.lags. _j[j] are the common MA parameters and j = 1,...,qj = 1,...,q (q = ma.ord), _l[l] are the common seasonal MA parameters and l = 1,...,Ql = 1,...,Q (Q = sma.ord) _k[k] are the parameters for the covariates. Finally, _1,i[1,i] and _2,i[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.

References

  • Gia21tseriesTARMA

  • 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

Run this code
## 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)

# \donttest{
## 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)

# }

Run the code above in your browser using DataLab