STVARResult._weight_at#
- STVARResult._weight_at(values)[source]#
The transition function at arbitrary transition values.
- Parameters:
values (
NDArray[double]) – Transition-variable values, in the original units.- Return type:
- Returns:
The weight on the upper regime at each value, in
[0, 1].
Example
The logistic weight is one half at the threshold; the exponential weight is zero there and symmetric about it:
>>> import numpy as np >>> y = np.random.default_rng(0).standard_normal((200, 2)) >>> logistic = STVAR(y, order=1, transition_variable="y1").fit() >>> bool(np.isclose(logistic._weight_at(np.array([logistic.threshold]))[0], 0.5)) True >>> exponential = STVAR( ... y, order=1, transition_variable="y1", transition="exponential" ... ).fit() >>> c = exponential.threshold >>> at = exponential._weight_at(np.array([c, c - 1.0, c + 1.0])) >>> bool(at[0] == 0.0), bool(np.isclose(at[1], at[2])), bool(0.0 < at[1] <= 1.0) (True, True, True)