<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def _ar_matrix(self):
 """ Creates Autoregressive matrix Returns X : np.ndarray Autoregressive Matrix """

        Y = np.array(self.data[self.max_lag:self.data.shape[0]])
        X = self.data[(self.max_lag-1):-1]

        if self.ar != 0:
            for i in range(1, self.ar):
                X = np.vstack((X,self.data[(self.max_lag-i-1):-i-1]))

        return X