# setar: Self Threshold Autoregressive model In tsDyn: Nonlinear Time Series Models with Regime Switching

## Description

Self Exciting Threshold AutoRegressive model.

## Usage

 ```1 2 3 4 5``` ```setar(x, m, d=1, steps=d, series, mL, mM, mH, thDelay=0, mTh, thVar, th, trace=FALSE, nested=FALSE, include = c( "const", "trend","none", "both"), common=c("none", "include","lags", "both"), model=c("TAR", "MTAR"), ML=seq_len(mL), MM=seq_len(mM), MH=seq_len(mH),nthresh=1,trim=0.15, type=c("level", "diff", "ADF"), restriction=c("none","OuterSymAll","OuterSymTh") ) ```

## Arguments

 `x` time series `m, d, steps` embedding dimension, time delay, forecasting steps `series` time series name (optional) `mL,mM, mH` autoregressive order for ‘low’ (mL) ‘middle’ (mM, only useful if nthresh=2) and ‘high’ (mH)regime (default values: m). Must be <=m. Alternatively, you can specify `ML` `thDelay` 'time delay' for the threshold variable (as multiple of embedding time delay d) `mTh` coefficients for the lagged time series, to obtain the threshold variable `thVar` external threshold variable `th` threshold value (if missing, a search over a reasonable grid is tried) `trace` should additional infos be printed? (logical) `include` Type of deterministic regressors to include `common` Indicates which elements are common to all regimes: no, only the `include` variables, the lags or both `ML,MM,MH` vector of lags for order for ‘low’ (ML) ‘middle’ (MM, only useful if nthresh=2) and ‘high’ (MH)regime. Max must be <=m `model` Currently not implemented `nthresh` Number of threshold of the model `trim` trimming parameter indicating the minimal percentage of observations in each regime. Default to 0.15 `type` Whether the variable is taken is level, difference or a mix (diff y= y-1, diff lags) as in the ADF test `restriction` Restriction on the threshold. `OuterSymAll` will take a symmetric threshold and symmetric coefficients for outer regimes. OuterSymTh currently unavailable `nested` Whether is this a nested call? (useful for correcting final model df) `...` further arguments to be passed to `nlar`

## Details

Self Exciting Threshold AutoRegressive model.

x[t+steps] = ( phi1[0] + phi1[1] x[t] + phi1[2] x[t-d] + … + phi1[mL] x[t - (mL-1)d] ) I( z[t] <= th) + ( phi2[0] + phi2[1] x[t] + phi2[2] x[t-d] + … + phi2[mH] x[t - (mH-1)d] ) I( z[t] > th) + eps[t+steps]

with z the threshold variable. The threshold variable can alternatively be specified by (in that order):

thDelay

`z[t] = x[t - thDelay*d ]`

mTh

`z[t] = x[t] mTh[1] + x[t-d] mTh[2] + ... + x[t-(m-1)d] mTh[m]`

thVar

`z[t] = thVar[t]`

For fixed `th` and threshold variable, the model is linear, so `phi1` and `phi2` estimation can be done directly by CLS (Conditional Least Squares). Standard errors for phi1 and phi2 coefficients provided by the `summary` method for this model are taken from the linear regression theory, and are to be considered asymptoticals.

## Value

An object of class `nlar`, subclass `setar`

## Author(s)

Antonio, Fabio Di Narzo

## References

Non-linear time series models in empirical finance, Philip Hans Franses and Dick van Dijk, Cambridge: Cambridge University Press (2000).

Non-Linear Time Series: A Dynamical Systems Approach, Tong, H., Oxford: Oxford University Press (1990).

`plot.setar` for details on plots produced for this model from the `plot` generic.

## Examples

 ```1 2 3 4 5 6 7 8 9``` ```#fit a SETAR model, with threshold as suggested in Tong(1990, p 377) mod.setar <- setar(log10(lynx), m=2, thDelay=1, th=3.25) mod.setar summary(mod.setar) if(require(FinTS)) { data(m.unrate) setar(diff(m.unrate), ML=c(2,3,4,12), MH=c(2,4,12), th=0.1, include="none") } ```

### Example output

```Warning message:
Possible unit root in the high  regime. Roots are: 0.8985 0.8985

Non linear autoregressive model

SETAR model ( 2 regimes)
Coefficients:
Low regime:
const.L     phiL.1     phiL.2
0.5908673  1.2538064 -0.4184042

High regime:
const.H    phiH.1    phiH.2
2.232671  1.526853 -1.238662

Threshold:
-Variable: Z(t) = + (0) X(t)+ (1)X(t-1)
-Value: 3.25 (fixed)
Proportion of points in low regime: 66.96% 	 High regime: 33.04%

Non linear autoregressive model

SETAR model ( 2 regimes)
Coefficients:
Low regime:
const.L     phiL.1     phiL.2
0.5908673  1.2538064 -0.4184042

High regime:
const.H    phiH.1    phiH.2
2.232671  1.526853 -1.238662

Threshold:
-Variable: Z(t) = + (0) X(t)+ (1)X(t-1)
-Value: 3.25 (fixed)
Proportion of points in low regime: 66.96% 	 High regime: 33.04%

Residuals:
Min         1Q     Median         3Q        Max
-0.5769141 -0.1198456  0.0034299  0.1191886  0.5173509

Fit:
residuals variance = 0.04053,  AIC = -353, MAPE = 5.76%

Coefficient(s):

Estimate  Std. Error  t value  Pr(>|t|)
const.L  0.590867    0.152011   3.8870 0.0001755 ***
phiL.1   1.253806    0.071265  17.5936 < 2.2e-16 ***
phiL.2  -0.418404    0.087630  -4.7746 5.690e-06 ***
const.H  2.232671    0.801695   2.7849 0.0063238 **
phiH.1   1.526853    0.103082  14.8121 < 2.2e-16 ***
phiH.2  -1.238662    0.255539  -4.8473 4.219e-06 ***
---
Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1

Threshold
Variable: Z(t) = + (0) X(t) + (1) X(t-1)

Value: 3.25 (fixed)

Attaching package: 'zoo'

The following objects are masked from 'package:base':

as.Date, as.Date.numeric

Non linear autoregressive model

SETAR model ( 2 regimes)
Coefficients:
Low regime:
phiL.2     phiL.3     phiL.4    phiL.12
0.1323476  0.1380201  0.1125542 -0.1608347

High regime:
phiH.2      phiH.4     phiH.12
0.40826143  0.06591605 -0.13897342

Threshold:
-Variable: Z(t) = + (1) X(t)+ (0)X(t-1)+ (0)X(t-2)+ (0)X(t-3)+ (0)X(t-4)+ (0)X(t-5)+ (0)X(t-6)+ (0)X(t-7)+ (0)X(t-8)+ (0)X(t-9)+ (0)X(t-10)+ (0)X(t-11)
-Value: 0.1 (fixed)
Proportion of points in low regime: 74.02% 	 High regime: 25.98%
```

tsDyn documentation built on May 29, 2017, 10:48 a.m.