statsmodels.tsa.statespace.tools.constrain_stationary_multivariate¶
- statsmodels.tsa.statespace.tools.constrain_stationary_multivariate(unconstrained, variance, transform_variance=False, prefix=None)[source]¶
Transform unconstrained parameters used by the optimizer to constrained parameters used in likelihood evaluation for a vector autoregression.
- Parameters:
- unconstrained
array
orlist
Arbitrary matrices to be transformed to stationary coefficient matrices of the VAR. If a list, should be a list of length order, where each element is an array sized k_endog x k_endog. If an array, should be the matrices horizontally concatenated and sized k_endog x k_endog * order.
- error_variance
ndarray
The variance / covariance matrix of the error term. Should be sized k_endog x k_endog. This is used as input in the algorithm even if is not transformed by it (when transform_variance is False). The error term variance is required input when transformation is used either to force an autoregressive component to be stationary or to force a moving average component to be invertible.
- transform_variancebool,
optional
Whether or not to transform the error variance term. This option is not typically used, and the default is False.
- prefix{‘s’,’d’,’c’,’z’},
optional
The appropriate BLAS prefix to use for the passed datatypes. Only use if absolutely sure that the prefix is correct or an error will result.
- unconstrained
- Returns:
Notes
In the notation of [1], the arguments (variance, unconstrained) are written as \((\Sigma, A_1, \dots, A_p)\), where \(p\) is the order of the vector autoregression, and is here determined by the length of the unconstrained argument.
There are two steps in the constraining algorithm.
First, \((A_1, \dots, A_p)\) are transformed into \((P_1, \dots, P_p)\) via Lemma 2.2 of [1].
Second, \((\Sigma, P_1, \dots, P_p)\) are transformed into \((\Sigma, \phi_1, \dots, \phi_p)\) via Lemmas 2.1 and 2.3 of [1].
If transform_variance=True, then only Lemma 2.1 is applied in the second step.
While this function can be used even in the univariate case, it is much slower, so in that case constrain_stationary_univariate is preferred.
References