compotime.models.LocalTrendParams#
- class compotime.models.LocalTrendParams(X_zero: ndarray, g: ndarray)#
Bases:
Params
Parameters for the local level model.
Notes
The seed state matrix (X_zero) repesents the value for the transition equation that describes how the state vectors evolve over time. The persistence vector (g) determines the extend of the innovation on the state. These are the only parameters that need to be estimated.
- Parameters:
X_zero (numpy.ndarray) – Seed state matrix.
g (numpy.ndarray) – Persistence vector.
- X_zero#
Seed state matrix.
- Type:
numpy.ndarray
- g#
Persistence vector.
- Type:
numpy.ndarray
- __init__(X_zero: ndarray, g: ndarray) None #
Methods
__init__
(X_zero, g)init
(time_series)Initialize parameters.
Attributes
Get the linear constraints for the parameters of the local trend model.
- __iter__() Iterator[ndarray] #
Iterate over the different parameters.
- Yields:
Iterator[np.ndarray] – Parameter.
- property constraints: list[LinearConstraint]#
Get the linear constraints for the parameters of the local trend model.
Notes
In the local trend model, g can be decomposed into \(\alpha\) and \(\beta\) parameters, which must be greater than or equal to zero and satisfy the following linear constraint:
\[2 \alpha + \beta \le 4.\]- Returns:
Linear constraints for the parameters of the local trend model.
- Return type:
list[LinearConstraint]
- classmethod init(time_series: ndarray) Self #
Initialize parameters.
- Parameters:
time_series – Observed time series.
- Returns:
Initialized parameters.
- Return type:
Self