# tar: Estimation of a TAR model In TSA: Time Series Analysis

## Description

Estimation of a two-regime TAR model.

## Usage

 ```1 2 3``` ```tar(y, p1, p2, d, is.constant1 = TRUE, is.constant2 = TRUE, transform = "no", center = FALSE, standard = FALSE, estimate.thd = TRUE, threshold, method = c("MAIC", "CLS")[1], a = 0.05, b = 0.95, order.select = TRUE, print = FALSE) ```

## Arguments

 `y` time series `p1` AR order of the lower regime `p2` AR order of the upper regime `d` delay parameter `is.constant1` if True, intercept included in the lower regime, otherwise the intercept is fixed at zero `is.constant2` similar to is.constant1 but for the upper regime `transform` available transformations: "no" (i.e. use raw data), "log", "log10" and "sqrt" `center` if set to be True, data are centered before analysis `standard` if set to be True, data are standardized before analysis `estimate.thd` if True, threshold parameter is estimated, otherwise it is fixed at the value supplied by threshold `threshold` known threshold value, only needed to be supplied if estimate.thd is set to be False. `method` "MAIC": estimate the TAR model by minimizing the AIC; "CLS": estimate the TAR model by the method of Conditional Least Squares. `a` lower percent; the threshold is searched over the interval defined by the a*100 percentile to the b*100 percentile of the time-series variable `b` upper percent `order.select` If method is "MAIC", setting order.select to True will enable the function to further select the AR order in each regime by minimizing AIC `print` if True, the estimated model will be printed

## Details

The two-regime Threshold Autoregressive (TAR) model is given by the following formula:

Y_t = φ_{1,0}+φ_{1,1} Y_{t-1} +…+ φ_{1,p} Y_{t-p_1} +σ_1 e_t, \mbox{ if } Y_{t-d}≤ r

Y_t = φ_{2,0}+φ_{2,1} Y_{t-1} +…+φ_{2,p_2} Y_{t-p}+σ_2 e_t, \mbox{ if } Y_{t-d} > r.

where r is the threshold and d the delay.

## Value

A list of class "TAR" which can be further processed by the by the predict and tsdiag functions.

Kung-Sik Chan

## References

Tong, H. (1990) "Non-linear Time Series, a Dynamical System Approach," Clarendon Press Oxford

"Time Series Analysis, with Applications in R" by J.D. Cryer and K.S. Chan

`predict.TAR`, `tsdiag.TAR`, `tar.sim`, `tar.skeleton`

## Examples

 ```1 2``` ```data(prey.eq) prey.tar.1=tar(y=log(prey.eq),p1=4,p2=4,d=3,a=.1,b=.9,print=TRUE) ```

### Example output

```Attaching package: 'TSA'

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

acf, arima

The following object is masked from 'package:utils':

tar

time series included in this analysis is:  log(prey.eq)
SETAR(2, 1 , 4 ) model delay = 3
estimated threshold =  4.661  from a Minimum AIC  fit with thresholds
searched from the  17  percentile to the   81  percentile of all data.
The estimated threshold is the  56.6  percentile of
all data.
lower regime:
Residual Standard Error=0.2341
R-Square=0.9978
F-statistic (df=2, 28)=6355.76
p-value=0

Estimate Std.Err t-value Pr(>|t|)
intercept-log(prey.eq)   0.2621  0.3156  0.8305   0.4133
lag1-log(prey.eq)        1.0175  0.0704 14.4455   0.0000

(unbiased) RMS
0.05479
with no of data falling in the regime being
log(prey.eq) 30

(max. likelihood) RMS for each series (denominator=sample size in the regime)
log(prey.eq) 0.05114

upper regime:
Residual Standard Error=0.2676
R-Square=0.9971
F-statistic (df=5, 18)=1253.556
p-value=0

Estimate Std.Err t-value Pr(>|t|)
intercept-log(prey.eq)   4.1986  1.2841  3.2697   0.0043
lag1-log(prey.eq)        0.7081  0.2023  3.5005   0.0026
lag2-log(prey.eq)       -0.3009  0.3118 -0.9648   0.3474
lag3-log(prey.eq)        0.2788  0.4063  0.6861   0.5014
lag4-log(prey.eq)       -0.6113  0.2726 -2.2427   0.0377

(unbiased) RMS
0.07158
with no of data falling in the regime being
23

(max. likelihood) RMS for each series (denominator=sample size in the regime)
0.05602

Nominal AIC is  10.92
```

TSA documentation built on July 2, 2018, 1:04 a.m.