def METHOD_NAME(x, p, q):
    np.random.seed(1)
    x0 = np.repeat(0.1, p + q + 1)
    bnds = ((0, None),) * len(x0)
    cons = {"type": "ineq", "fun": garch_cons}
    opt = minimize(
        garch_loglik, x0, args=(x, p, q), method="SLSQP", bounds=bnds, constraints=cons
    )
    coeff = opt.x
    sigma2 = garch_sigma2(coeff, x, p, q)
    fitted = np.full((len(x),), np.nan)
    for k in range(p, len(x)):
        error = np.random.normal(loc=0, scale=1)
        fitted[k] = error * np.sqrt(sigma2[k])
    res = {
        "p": p,
        "q": q,
        "coeff": coeff,
        "message": opt.message,
        "y_vals": x[-p:],
        "sigma2_vals": sigma2[-q:],
        "fitted": fitted,
    }
    return res