We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 04a5dde commit a6fc07aCopy full SHA for a6fc07a
inst/python/distributions/tweedie.py
@@ -97,12 +97,12 @@ def _log_prob(self, x):
97
u *= 1 / ((1 - self.p) * (2 - self.p))
98
return llf - u
99
100
- else: # from https://github.com/cran/statmod/blob/master/R/tweedie.R deviance residuals
+ else: # from https://github.com/cran/statmod/blob/master/R/tweedie.R negative deviance residuals
101
x1 = x + 0.1 * tf.cast(tf.equal(x, 0), tf.float32)
102
theta = (tf.pow(x1, 1 - self.p) - tf.pow(self.loc, 1 - self.p)) / (1 - self.p)
103
kappa = (tf.pow(x, 2 - self.p) - tf.pow(self.loc, 2 - self.p)) / (2 - self.p)
104
105
- return 2 * (x * theta - kappa)
+ return - 1 * tf.pow(x * theta - kappa, 2)
106
107
108
def _mean(self):
0 commit comments