

def _constrain_sv_less_than_one_python(unconstrained, order=None, k_endog=None):
    '\n    Transform arbitrary matrices to matrices with singular values less than\n    one.\n\n    Parameters\n    ----------\n    unconstrained : list\n        Arbitrary matrices. Should be a list of length `order`, where each\n        element is an array sized `k_endog` x `k_endog`.\n    order : integer, optional\n        The order of the autoregression.\n    k_endog : integer, optional\n        The dimension of the data vector.\n\n    Returns\n    -------\n    constrained : list\n        Partial autocorrelation matrices. Should be a list of length\n        `order`, where each element is an array sized `k_endog` x `k_endog`.\n\n    Notes\n    -----\n    Corresponds to Lemma 2.2 in Ansley and Kohn (1986). See\n    `constrain_stationary_multivariate` for more details.\n\n    There is a Cython implementation of this function that can be much faster,\n    but which requires SciPy 0.14.0 or greater. See\n    `constrain_stationary_multivariate` for details.\n\n    '
    from scipy import linalg
    constrained = []
    if (order is None):
        order = len(unconstrained)
    if (k_endog is None):
        k_endog = unconstrained[0].shape[0]
    eye = np.eye(k_endog)
    for i in range(order):
        A = unconstrained[i]
        (B, lower) = linalg.cho_factor((eye + np.dot(A, A.T)), lower=True)
        constrained.append(linalg.solve_triangular(B, A, lower=lower))
    return constrained

dataset/ETHPy150Open statsmodels/statsmodels/statsmodels/tsa/statespace/tools.py _constrain_sv_less_than_one_python/original