def get_rv(self,signal):
#extract parameters
N,p=signal.H1.shape
if self.type=="PFA":
if self.detector.estimate_sigma2==True:
rv=f(p,s-p)
else:
rv=chi2(p)
if self.type=="PD":
H1=np.matrix(signal.H1)
x1=np.matrix(signal.x1).T
H2=np.matrix(signal.H2)
x2=np.matrix(signal.x2).T
sigma2=signal.sigma2
#compute non central parameter
PH2_perp=np.eye(H2.shape[0])-H2*lg.inv(H2.T*H2)*H2.T
y=H1*x1
nc=y.T*PH2_perp*y/sigma2
nc=min(np.asscalar(nc),self.nc_max)
if self.detector.estimate_sigma2==True:
N,t=H2.shape
s=N-t
rv=ncf(p,s-p,nc)
else:
rv=ncx2(p,nc)
return rv
评论列表
文章目录