Example #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
Example #2
0
 def lr_effect_stderr(self, orth=False):
     cov = self.lr_effect_cov(orth=orth)
     return tsa.unvec(np.sqrt(np.diag(cov)))
Example #3
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)])
Example #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)
     ])
Example #5
0
 def lr_effect_stderr(self, orth=False):
     cov = self.lr_effect_cov(orth=orth)
     return tsa.unvec(np.sqrt(np.diag(cov)))