

def constrain_stationary_univariate(unconstrained):
    '\n    Transform unconstrained parameters used by the optimizer to constrained\n    parameters used in likelihood evaluation\n\n    Parameters\n    ----------\n    unconstrained : array\n        Unconstrained parameters used by the optimizer, to be transformed to\n        stationary coefficients of, e.g., an autoregressive or moving average\n        component.\n\n    Returns\n    -------\n    constrained : array\n        Constrained parameters of, e.g., an autoregressive or moving average\n        component, to be transformed to arbitrary parameters used by the\n        optimizer.\n\n    References\n    ----------\n    .. [1] Monahan, John F. 1984.\n       "A Note on Enforcing Stationarity in\n       Autoregressive-moving Average Models."\n       Biometrika 71 (2) (August 1): 403-404.\n    '
    n = unconstrained.shape[0]
    y = np.zeros((n, n), dtype=unconstrained.dtype)
    r = (i / ((1 + (unconstrained ** 2)) ** 0.5))
    for k in range(n):
        for i in range(k):
            y[(k, i)] = (y[((k - 1), i)] + (r[k] * y[((k - 1), ((k - i) - 1))]))
        y[(k, k)] = r[k]
    return (- y[(n - 1), :])

dataset/ETHPy150Open statsmodels/statsmodels/statsmodels/tsa/statespace/tools.py constrain_stationary_univariate/VarMisuse@43/334 `unconstrained`->`i`