To calculate the model log-likelihood function.
TAR.lik(ay, p1, p2, ph.1, ph.2, sig.1, sig.2,
lagd, thres, lagp1, lagp2, constant = 1, thresVar)
The real data set. (input)
Number of AR coefficients in regime one.
Number of AR coefficients in regime two.
The vector of AR parameters in regime one.
The vector of AR parameters in regime two.
The error terms of AR model in the regime one.
The error terms of AR model in the regime two.
The delay lag parameter.
The threshold parameter.
The vector of non-zero autoregressive lags for the lower regime. (regime one); e.g. An AR model with p1=3, it could be non-zero lags 1,3, and 5 would set lagp1<-c(1,3,5).
The vector of non-zero autoregressive lags for the upper regime. (regime two)
Use the CONSTANT option to fit a model with/without a constant term (1/0). By default CONSTANT=1.
Exogenous threshold variable. (if missing, the series x is used)