'Estimate the coefficients of the linear model.
Parameters
X : array, shape (n_samples, n_features)
The training input samples to estimate the linear coefficients.
y : array, shape (n_samples, n_outputs)
The target values.
Returns
self : instance of TimeDelayingRidge
Returns the modified instance.'

def fit(self, X, y):

    if self.fit_intercept:
        X_offset = np.mean(X, axis=0)
        X = (X - X_offset)
        y_offset = np.mean(y, axis=0)
        y = (y - y_offset)
    else:
        X_offset = y_offset = 0.0
    (x_xt, x_y, n_ch_x) = _compute_corrs(X, y, self._smin, self._smax)
    self.coef_ = _fit_corrs(x_xt, x_y, n_ch_x, self.reg_type, self.alpha, n_ch_x)
    self.coef_ = self.coef_[..., ::(-1)]
    if self.fit_intercept:
        self.intercept_ = (y_offset - np.dot(X_offset, self.coef_.sum((-1)).T))
    else:
        self.intercept_ = 0.0
    return self
