def _ses_forecast(x: np.ndarray, alpha: float) -> Tuple[float, np.ndarray]:
    r"""Compute the one-step ahead forecast for a simple exponential smoothing fit.

    Parameters
    ----------
    x : numpy.array
        Clean time series of shape (n, ).
    alpha : float
        Smoothing parameter.

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

    """
    complement = 1 - alpha
    fitted = np.empty_like(x)
    fitted[0] = x[0]
    j = 0

    for i in range(1, len(x)):
        fitted[i] = alpha * x[j] + complement * fitted[j]
        j += 1

    forecast = alpha * x[j] + complement * fitted[j]
    fitted[0] = np.nan
    return forecast, fitted
Compute the one-step ahead forecast for a simple exponential smoothing fit.

    Parameters
    ----------
    x : numpy.array
        Clean time series of shape (n, ).
    alpha : float
        Smoothing parameter.

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

    
python/statsforecast/models.py