I have a Poisson model that is performing well. Now we need to put it into Java code and release it to the world. What is the equation that I plug the Poisson coefficients into?
Similar to this question: Find the equation from generalized linear model output
Here is some sample code from R that shows what I am doing:
d = data.frame(y=(10:100)^-1*100, x=10:100)
m = glm(y~x, data=d, family=poisson(link="log"))
plot(d$x, predict.glm(m, type="response"))
points(d$x, d$y, col="blue")
summary(m)
output:
Call:
glm(formula = y ~ x, family = poisson(link = "log"), data = d)
Deviance Residuals:
Min 1Q Median 3Q Max
-0.34781 -0.25933 -0.05075 0.21286 1.20265
Coefficients:
Estimate Std. Error z value Pr(>|z|)
(Intercept) 2.155676 0.126778 17.004 <2e-16 ***
x -0.025912 0.002819 -9.191 <2e-16 ***
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
(Dispersion parameter for poisson family taken to be 1)
Null deviance: 104.5820 on 90 degrees of freedom
Residual deviance: 8.5623 on 89 degrees of freedom
AIC: Inf
Number of Fisher Scoring iterations: 4
> cor(d$y, predict.glm(m, type="response"))
[1] 0.9461024
That is pretty good! :)