STARResult.regime_weight#

property STARResult.regime_weight: NDArray[float64][source]#

The transition function evaluated over the sample.

Reproduces the estimator’s own weighting exactly, including the clipping of the exponent – an extreme gamma saturates the weight rather than overflowing exp. The logistic form is monotone in the standardized transition variable, so the two regimes are asymmetric; the exponential form is symmetric about the threshold, so both tails share a regime and the middle is the other.

Example

The weights reproduce the fitted values from the two blocks:

>>> import numpy as np
>>> from cultivars.engine._core._matrices import _lag_matrix
>>> rng = np.random.default_rng(0)
>>> y = rng.standard_normal(300)
>>> res = LSTAR(y, order=1).fit()
>>> w = res.regime_weight
>>> base = np.column_stack([np.ones(res.nobs), _lag_matrix(y, 1)])
>>> blend = (1 - w) * (base @ res.lower_params) + w * (base @ res.upper_params)
>>> bool(np.allclose(blend, res.fittedvalues)), bool(0 <= w.min() <= w.max() <= 1)
(True, True)