def _optimized_ses_forecast(
    x: np.ndarray, bounds: Tuple[float, float] = (0.1, 0.3)
) -> Tuple[float, np.ndarray]:
    r"""Compute the one-step ahead forecast for an optimal simple exponential smoothing fit.

    Parameters
    ----------
    x : numpy.array
        Clean time series of shape (n, ).
    bounds : tuple of (float, float)
        Lower and upper optimisation bounds for alpha.

    Returns
    -------
    tuple of (float, numpy.array)
        One-step ahead forecast and in-sample fitted values.

    """
    alpha = minimize_scalar(
        fun=_ses_sse,
        bounds=bounds,
        args=(x,),
    ).x
    forecast, fitted = _ses_forecast(x, alpha)
    return forecast, fitted
Compute the one-step ahead forecast for an optimal simple exponential smoothing fit.

    Parameters
    ----------
    x : numpy.array
        Clean time series of shape (n, ).
    bounds : tuple of (float, float)
        Lower and upper optimisation bounds for alpha.

    Returns
    -------
    tuple of (float, numpy.array)
        One-step ahead forecast and in-sample fitted values.

    
python/statsforecast/models.py