def lnfunc(self,args):
if self.eargs['outliers'] == False:
temp1=(args['y']-(self.args['m']*self.args['x']+self.args['c']))/args['sigma_y']
return -0.5*(temp1*temp1)-np.log(np.sqrt(2*np.pi)*args['sigma_y'])
else:
temp11=scipy.stats.norm.pdf(args['y'],loc=(self.args['m']*self.args['x']+self.args['c']),scale=args['sigma_y'])
sigma_b=np.sqrt(np.square(args['sigma_y'])+np.square(args['sigma_b']))
temp22=scipy.stats.norm.pdf(args['y'],loc=self.args['mu_b'],scale=sigma_b)
return np.log((1-args['p_b'])*temp11+args['p_b']*temp22)
评论列表
文章目录