SETARResult._weight_at#
- SETARResult._weight_at(z)[source]#
Indicator of the upper regime at one transition value.
The scalar form of
regime_weightthatsimulateconsults at each step; strict on the upper side like the estimator.- Parameters:
z (
float) – The transition variable.- Return type:
- Returns:
1.0ifzexceeds the threshold, else0.0.
Example
>>> import numpy as np >>> rng = np.random.default_rng(0) >>> y = np.zeros(300) >>> for t in range(1, 300): ... y[t] = (0.6 if y[t - 1] <= 0.0 else -0.4) * y[t - 1] + rng.standard_normal() >>> res = SETAR(y, order=1, delay=1).fit() >>> res._weight_at(res.threshold), res._weight_at(res.threshold + 1e-9) (0.0, 1.0)