SETARResult._weight_at#

SETARResult._weight_at(z)[source]#

Indicator of the upper regime at one transition value.

The scalar form of regime_weight that simulate consults at each step; strict on the upper side like the estimator.

Parameters:

z (float) – The transition variable.

Return type:

float

Returns:

1.0 if z exceeds the threshold, else 0.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)