var.py 文件源码

python
阅读 41 收藏 0 点赞 0 评论 0

项目:pyflux 作者: RJT1990 项目源码 文件源码
def estimator_cov(self,method):
        """ Creates covariance matrix for the estimators

        Parameters
        ----------
        method : str
            Estimation method

        Returns
        ----------
        A Covariance Matrix
        """         

        Y = np.array([reg[self.lags:] for reg in self.data])    
        Z = self._create_Z(Y)
        if method == 'OLS':
            sigma = self.ols_covariance()
        else:           
            sigma = self.custom_covariance(self.latent_variables.get_z_values())
        return np.kron(np.linalg.inv(np.dot(Z,np.transpose(Z))), sigma)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号