TVARResult.regime_weight#
- property TVARResult.regime_weight: NDArray[float64][source]#
1.0above the threshold, else0.0.Strict on the upper side, matching the estimator’s
z <= rassignment to the lower regime, so a transition value landing exactly on the threshold is counted here as it was when the coefficients were solved for.- Returns:
An array of length
nobswith entries in{0.0, 1.0}, aligned withresid; its sum isn_upper.
Example
>>> import numpy as np >>> y = np.random.default_rng(0).standard_normal((200, 2)) >>> res = TVAR(y, order=1, transition_variable="y1", delay=1).fit() >>> weight = res.regime_weight >>> weight.shape, sorted(set(weight.tolist())), int(weight.sum()) == res.n_upper ((199,), [0.0, 1.0], True) >>> bool(np.all(weight == (res.threshold_values > res.threshold))) True
- Type:
Indicator of the upper regime