def fit(self, signal):
        """Set parameters of the instance. The signal must be 1D.

        Args:
            signal (array): 1d signal. Shape (n_samples, 1) or (n_samples,).

        Returns:
            self: the current object
        """
        self.signal = deepcopy(signal)
        if signal.ndim == 1:
            self.signal = self.signal.reshape(-1, 1)

        # lagged covariates
        n_samples, _ = self.signal.shape
        strides = (self.signal.itemsize, self.signal.itemsize)
        shape = (n_samples - self.order, self.order)
        lagged = as_strided(self.signal, shape=shape, strides=strides)
        # pad the first columns
        lagged_after_padding = np.pad(lagged, ((self.order, 0), (0, 0)), mode="edge")
        # add intercept
        self.covar = np.c_[lagged_after_padding, np.ones(n_samples)]
        # pad signal on the edges
        self.signal[: self.order] = self.signal[self.order]
        return self
Set parameters of the instance. The signal must be 1D.

        Args:
            signal (array): 1d signal. Shape (n_samples, 1) or (n_samples,).

        Returns:
            self: the current object
        
src/ruptures/costs/costautoregressive.py