def _ses_sse(alpha: float, x: np.ndarray) -> float:
    r"""Compute the residual sum of squares for a simple exponential smoothing fit.

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

    Returns
    -------
    sse : float
        Residual sum of squares for the fit.

    """
    complement = 1 - alpha
    forecast = x[0]
    sse = 0.0

    for i in range(1, len(x)):
        forecast = alpha * x[i - 1] + complement * forecast
        sse += (x[i] - forecast) ** 2

    return sse
Compute the residual sum of squares for a simple exponential smoothing fit.

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

    Returns
    -------
    sse : float
        Residual sum of squares for the fit.

    
python/statsforecast/models.py