model.py 文件源码

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

项目:linearmodels 作者: bashtage 项目源码 文件源码
def _f_statistic(self, params, cov, debiased):
        non_const = ~(self._x.ptp(0) == 0)
        test_params = params[non_const]
        test_cov = cov[non_const][:, non_const]
        test_stat = test_params.T @ inv(test_cov) @ test_params
        test_stat = float(test_stat)
        nobs, nvar = self._x.shape
        null = 'All parameters ex. constant are zero'
        name = 'Model F-statistic'
        df = test_params.shape[0]
        if debiased:
            wald = WaldTestStatistic(test_stat / df, null, df, nobs - nvar,
                                     name=name)
        else:
            wald = WaldTestStatistic(test_stat, null, df, name=name)

        return wald
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号