LSTAR#
- class cultivars.univariate.smooth_transition.LSTAR(endog, *, order, delay=1)[source]#
Logistic smooth-transition autoregression.
The weight \(G(z) = \bigl(1 + \exp(-\gamma (z - c) / s)\bigr)^{-1}\) rises monotonically through the threshold, so the two regimes are genuinely different states and the dynamics differ above and below. Use this when the asymmetry has a direction – contractions behaving differently from expansions, for instance. The transition variable is the series’ own lag \(y_{t-d}\); \(\gamma\) and \(c\) are searched by multi-start Nelder-Mead over a grid of speeds and two candidate thresholds, with the regime blocks concentrated out by least squares at each step.
- Variables:
_endog – The validated series.
_order – Autoregressive order within each regime.
_delay – Delay of the transition variable.
_transition –
"logistic".
- Parameters:
- Raises:
SpecificationError – If
orderordelayis not a positive integer.DimensionError – If
endogis not one-dimensional or has fewer than2(order + 2) + delayobservations.NumericalError – If
endogcontains non-finite values, or (atfit()) the transition variable has zero variance.
See also
STARResult– whatfit()returns.ESTAR– the symmetric transition.SETAR– the hard-switch limit, which this fit reports throughSTARResult.is_effectively_abrupt.
References
Terasvirta, T. (1994). Specification, estimation, and evaluation of smooth transition autoregressive models. Journal of the American Statistical Association, 89(425), 208-218.
Example
>>> import numpy as np >>> rng = np.random.default_rng(0) >>> y = np.zeros(600) >>> for t in range(1, 600): ... w = 1.0 / (1.0 + np.exp(-10.0 * y[t - 1])) ... y[t] = (1 - w) * (0.5 + 0.6 * y[t - 1]) + w * (-0.5 - 0.6 * y[t - 1]) ... y[t] += 0.3 * rng.standard_normal() >>> res = LSTAR(y, order=1).fit() >>> res._comparison_label(), bool(abs(res.threshold) < 0.1) ('LSTAR(1, d=1)', True) >>> bool(res.lower_params[1] > 0.4), bool(res.upper_params[1] < -0.4) (True, True)
Attributes#
The transition-variable delay. |
|
The validated endogenous series. |
|
AR order per regime. |
|
The transition function family. |
Methods#
|
Estimate the transition by concentrated least squares. |