简体   繁体   English

H2O 中的负二项式偏差计算

[英]Negative Binomial Deviance Calculation in H2O

I've been looking at the deviance calculation for negative binomial model in H2O ( code line 580/959) and I'm struggling to reason why it is 0 when yr or ym is/are 0.我一直在研究 H2O 中负二项式 model 的偏差计算( 代码行 580/959),我很难解释为什么当 yr 或 ym 为 0 时它为 0。

(yr==0||ym==0)?0:2*((_invTheta+yr)*Math.log((1+_theta*ym)/(1+_theta*yr))+yr*Math.log(yr/ym))

The formula for the deviance calculation is as below (from H2O Documentation ):偏差计算公式如下(来自H2O 文档):

在此处输入图像描述

Going with maths, I don't see the deviance is 0 unless both yr and ym are 0.与数学一起,我看不到偏差为 0,除非 yr 和 ym 都为 0。

Does anyone happen to know if there is a special case where deviance for negative binomial needs to be set to 0 when either of the yr and ym is/are 0?有谁碰巧知道是否存在特殊情况,当 yr 和 ym 中的任何一个为/为 0 时,负二项式的偏差需要设置为 0?

Thanks!谢谢!

I'm not sure, but it seems to me they maybe just chose the lazy way out of a numerical difficulty.我不确定,但在我看来,他们可能只是出于数字困难而选择了懒惰的方式。

mu=0 ( ym ) is a degenerate case where p=0 and so y=0 always. mu=0 ( ym ) 是退化的情况,其中p=0并且y=0总是。 It's not interesting, and not really part of any useful analysis.这并不有趣,也不是任何有用分析的一部分。 I'm not sure it can even come out with the linear-predictor.我不确定它甚至可以与线性预测器一起出现。 With using the natural parameter = linear predictor, you need the linear predictor to be equal to minus infinity...使用自然参数 = 线性预测器,您需要线性预测器等于负无穷大...

However, y can be equal to 0 for other mu 's.但是,对于其他muy可以等于0 And what you do in this case, is take the limit of the deviance as y->0 , which is completely defined for Negative-Binomial, and isn't equal to 0. They could have implemented it, but chose not too, so this is why I call it "lazy".在这种情况下,您所做的是将偏差的限制设为y->0 ,这完全是为负二项式定义的,并且不等于 0。他们本可以实现它,但没有选择太多,所以这就是我称之为“懒惰”的原因。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM