'estimate parameters using ols
Parameters
nlags : integer
number of lags to include in regression, same for all variables
Returns
None, but attaches
arhat : array (nlags, nvar, nvar)
full lag polynomial array
arlhs : array (nlags-1, nvar, nvar)
reduced lag polynomial for left hand side
other statistics as returned by linalg.lstsq : need to be completed
This currently assumes all parameters are estimated without restrictions.
In this case SUR is identical to OLS
estimation results are attached to the class instance'

def fit(self, nlags):

    self.nlags = nlags
    nvars = self.nvars
    lmat = lagmat(self.y, nlags, trim='both', original='in')
    self.yred = lmat[:, :nvars]
    self.xred = lmat[:, nvars:]
    res = np.linalg.lstsq(self.xred, self.yred)
    self.estresults = res
    self.arlhs = res[0].reshape(nlags, nvars, nvars)
    self.arhat = ar2full(self.arlhs)
    self.rss = res[1]
    self.xredrank = res[2]
