$$ x_{t+s} = ( \phi_{1,0} + \phi_{1,1} x_t + \phi_{1,2} x_{t-d} + \dots +
\phi_{1,mL} x_{t - (mL-1)d} ) G( z_t, th, \gamma ) +
( \phi_{2,0} + \phi_{2,1} x_t + \phi_{2,2} x_{t-d} + \dots + \phi_{2,mH}
x_{t - (mH-1)d} ) (1 - G( z_t, th, \gamma ) ) + \epsilon_{t+steps}$$
with z the threshold variable, and \(G\) the logistic function,
computed as plogis(q, location = th, scale = 1/gamma)
, so see
plogis
documentation for details on the logistic function
formulation and parameters meanings.
The threshold variable can alternatively be specified by:
- mTh
\(z[t] = x[t] mTh[1] + x[t-d] mTh[2] + \dots +
x[t-(m-1)d] mTh[m]\)
- thDelay
\(z[t] = x[t - thDelay*d ]\)
- thVar
\(z[t] = thVar[t]\)
Note that if starting values for phi1 and phi2 are provided, isn't
necessary to specify mL
and mH
. Further, the user has to specify only
one parameter between mTh
, thDelay
and thVar
for indicating the
threshold variable.
Estimation of the transition parameters th and gamma, as well as the regression parameters
phi1 and phi2, is done using concentrated least squares, as suggested in Leybourne et al. (1996).
Given th and gamma, the model is linear, so regression coefficients
can be obtained as usual by OLS. So the nonlinear numerical search needs only to be done for th and gamma;
the regression parameters are then recovered by OLS again from the optimal th and gamma.
For the nonlinear estimation of the
parameters th and gamma, the program uses the
optim
function, with optimization method BFGS using the analytical gradient.
For the estimation of standard values, optim
is re-run
using the complete Least Squares objective function, and the standard errors are obtained by inverting the hessian.
You can pass further arguments to optim directly with the control
list argument. For instance, the option maxit
maybe useful when
there are convergence issues (see examples).
Starting parameters are obtained doing a simple two-dimensional grid-search over th and gamma.
Parameters of the grid (interval for the values, dimension of the grid) can be passed to starting.control
.
nTh
The number of threshold values (th) in the grid. Defaults to 200
nGamma
The number of smoothing values (gamma) in the grid. Defaults to 40
trim
The minimal percentage of observations in each regime. Defaults to 10% (possible threshold values are between the 0.1 and 0.9 quantile)
gammaInt
The lower and higher smoothing values of the grid. Defaults to c(1,40)
thInt
The lower and higher threshold values of the grid. When not specified (default, i.e NA), the interval are the trim
quantiles above.