statistics.py 文件源码

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

项目:parametrix 作者: vincentchoqueuse 项目源码 文件源码
def get_rv(self,signal):

        check_MD(signal.X)

        #extract parameters
        N=signal.N
        r,p=self.detector.A.shape

        if self.type=="PFA":

            if self.detector.estimate_sigma2==True:
                rv=f(r,N-p)
            else:
                rv=chi2(r)

        if self.type=="PD":

            #construct matrices
            A=np.matrix(self.detector.A)
            b=np.matrix(self.detector.b).T
            H=np.matrix(signal.H)
            x=np.matrix(signal.X)
            sigma2=signal.sigma2

            #compute the non central parameter
            term1=A*x-b
            nc=term1.T*lg.inv(A*lg.inv(H.T*H)*A.T)*term1/sigma2
            nc=min(np.asscalar(nc),self.nc_max)

            if self.detector.estimate_sigma2==True:
                rv=ncf(r,N-p,nc)
            else:
                rv=ncx2(r,nc)

        return rv


###### LINEAR MODEL WITH INTERFERENCE ##################################
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号