SETARResult#
- class cultivars.univariate.threshold.SETARResult(*, endog, fittedvalues, resid, llf, nobs, n_params, order, delay, threshold, threshold_values, lower_params, upper_params, sigma2, ssr, self_exciting, n_lower, n_upper, searched_delay)[source]#
A fitted hard-threshold autoregression.
Two linear autoregressions selected by an indicator on a lagged transition variable,
\[\begin{split}y_t = \begin{cases} \phi_L' x_t + \varepsilon_t & z_{t-d} \le r \\ \phi_U' x_t + \varepsilon_t & z_{t-d} > r \end{cases}, \qquad x_t = (1, y_{t-1}, \ldots, y_{t-p})', \quad \varepsilon_t \sim (0, \sigma^2),\end{split}\]with \(z_t = y_t\) for the self-exciting
SETARand an external series forTAR. Conditional on \((r, d)\) the model is two least-squares problems, so the estimator is a grid search: every candidate threshold on a trimmed quantile grid of the transition variable (and every candidate delay, when the caller left it open) is scored by the total sum of squares and the minimizer is kept. The record stores the split point, the regime assignment and the two coefficient blocks; the inherited fields, the per-regime stability verdicts, the information criteria and the refusal of the likelihood-ratio test come from_ObservedRegimeResult.Note
The assignment is
z <= rto the lower regime, and every reader of the fit –regime_weight,_weight_at,simulateandnonlinear_state_space– uses the same strict comparison on the upper side, so a transition value landing exactly on the threshold is counted as it was when the coefficients were solved for.n_paramscounts the two coefficient blocks and the threshold, not the variance, so the criteria are comparable withSTARResultbut sit one parameter below the linear families’ convention.searched_delayisTrueonly when more than one delay was on the grid:SETAR(y, order=1)has nothing to search.- Variables:
self_exciting – Whether the transition variable is a lag of the series itself (
SETAR) or an external variable (TAR).n_lower – Observations assigned to the lower regime.
n_upper – Observations assigned to the upper regime.
searched_delay – Whether the delay was chosen by the grid search rather than fixed by the caller.
See also
SETAR– the self-exciting model that produces this record.TAR– the externally driven model that produces this record.STARResult– the same two regimes blended by a smooth weight.MarkovSwitchingARResult– regimes driven by a latent chain rather than an observed variable.
References
Tong, H. (1990). Non-linear Time Series: A Dynamical System Approach. Oxford University Press, ch. 3.
Hansen, B. E. (1997). Inference in TAR models. Studies in Nonlinear Dynamics and Econometrics, 2(1), 1-14.
Example
A two-regime AR(1) with a switch at zero, recovered with its split:
>>> import numpy as np >>> rng = np.random.default_rng(0) >>> y = np.zeros(400) >>> for t in range(1, 400): ... phi = 0.6 if y[t - 1] <= 0.0 else -0.4 ... y[t] = phi * y[t - 1] + rng.standard_normal() >>> res = SETAR(y, order=1, delay=1).fit() >>> res.self_exciting, res.searched_delay, res.n_lower, res.n_upper, res.nobs (True, False, 288, 111, 399) >>> bool(abs(res.threshold) < 0.3), bool(abs(res.lower_params[1] - 0.6) < 0.1) (True, True) >>> bool(abs(res.upper_params[1] + 0.4) < 0.25), res.is_regimewise_stationary (True, True) >>> res.n_params, round(res.sigma2, 2) (5, 0.99)
Attributes#
Whether the transition variable is the series' own lag ( |
|
Observations assigned to the lower regime ( |
|
Observations assigned to the upper regime ( |
|
Whether the delay was selected by the grid rather than fixed by the caller. |
|
AIC, BIC, and HQIC derived from the likelihood and parameter count. |
|
Whether both regimes are stationary read as linear autoregressions. |
|
Companion-eigenvalue verdict for the lower-regime AR block. |
|
Estimated parameters keyed by display name, in table order. |
|
|
|
Share of the effective sample assigned to the upper regime. |
|
Companion-eigenvalue verdict for the upper-regime AR block. |
Methods#
|
Rank this result against others by an information criterion. |
|
Refuse the test: the threshold is unidentified under the null. |
|
The fitted threshold mean as a noisily observed state space. |
|
A fresh sample path at the fitted parameters. |
|
The estimation summary, renderable as text, HTML, or a dataframe. |
|
The aligned per-observation outputs as plain numpy arrays. |
|
The aligned per-observation outputs as a |
The aligned per-observation outputs as a |