def get_var_endog(y, lags, trend='c', has_constant='skip'):
 nobs = len(y)
 Z = np.array([y[(t - lags):t][::(-1)].ravel() for t in range(lags, nobs)])
 if (trend != 'nc'):
  Z = tsa.add_trend(Z, prepend=True, trend=trend, has_constant=has_constant)
 return Z

def get_var_endog ( y , lags , trend = 'c' , has_constant = 'skip' ) : nobs = len ( y ) Z = np . array ( [ y [ ( t - lags ) : t ] [ : : ( - 1 ) ] . ravel ( ) for t in range ( lags , nobs ) ] ) if ( trend != 'nc' ) : Z = tsa . add_trend ( Z , prepend = True , trend = trend , has_constant = has_constant ) return Z
make predictor matrix for var(p) process z := .