示例#1
0
def _var_acf(coefs, sig_u):
    """
    Compute autocovariance function ACF_y(h) for h=1,...,p

    Notes
    -----
    Lutkepohl (2005) p.29
    """
    p, k, k2 = coefs.shape
    assert(k == k2)

    A = util.comp_matrix(coefs)
    # construct VAR(1) noise covariance
    SigU = np.zeros((k*p, k*p))
    SigU[:k,:k] = sig_u

    # vec(ACF) = (I_(kp)^2 - kron(A, A))^-1 vec(Sigma_U)
    vecACF = L.solve(np.eye((k*p)**2) - np.kron(A, A), vec(SigU))

    acf = unvec(vecACF)
    acf = acf[:k].T.reshape((p, k, k))

    return acf
示例#2
0
文件: irf.py 项目: AnaMP/statsmodels
 def lr_effect_stderr(self, orth=False):
     cov = self.lr_effect_cov(orth=orth)
     return tsa.unvec(np.sqrt(np.diag(cov)))
示例#3
0
文件: irf.py 项目: AnaMP/statsmodels
 def cum_effect_stderr(self, orth=False):
     return np.array([tsa.unvec(np.sqrt(np.diag(c)))
                      for c in self.cum_effect_cov(orth=orth)])
示例#4
0
 def cum_effect_stderr(self, orth=False):
     return np.array([
         tsa.unvec(np.sqrt(np.diag(c)))
         for c in self.cum_effect_cov(orth=orth)
     ])
示例#5
0
文件: irf.py 项目: zqwght/statsmodels
 def lr_effect_stderr(self, orth=False):
     cov = self.lr_effect_cov(orth=orth)
     return tsa.unvec(np.sqrt(np.diag(cov)))