Solved – Estimating standard deviation in Poisson regression

generalized linear modelpoisson distributionregressionstandard deviation

I'm interested in an estimator of the standard deviation in a Poisson regression. So the variance is

$$Var(y)=\phi\cdot V(\mu)$$

where $\phi=1$ and $V(\mu)=\mu$. So the variance should be $Var(y)=V(\mu)=\mu$. (I'm just interested in how the variance should be, so if overdispersion occurs ($\widehat{\phi}\neq 1$), I don't care about it). Thus an estimator of the variance should be

$$\widehat{Var}(y)=V(\widehat{\mu})=\widehat{\mu}$$

and an estimator of the standard deviation should be

$$\sqrt{\widehat{Var}(y)}=\sqrt{V(\widehat{\mu})}=\sqrt{\widehat{\mu}}.$$

Is this correct? I haven't found a discussion about standard deviation in the context with Poisson regression yet, that's why I'm asking.

Example:

So here is an easy example (which makes no sense btw) of what I'm talking about.

data1 <- function(x) {x^(2)}
numberofdrugs <- data1(1:84)
data2 <- function(x) {x}   
healthvalue <- data2(1:84)
plot(healthvalue, numberofdrugs)
test <- glm(numberofdrugs ~ healthvalue, family=poisson)
summary(test) #beta0=5.5 beta1=0.042
mu <- function(x) {exp(5.5+0.042*x)}
plot(healthvalue, numberofdrugs)
curve(mu,  add=TRUE, col="purple", lwd=2)
# the purple curve is the estimator for mu and it's also 
# the estimator of the variance,but if I'd like to plot 
# the (not constant) standard deviation I just take the 
# square root of the variance. So it is var(y)=mu=exp(Xb) 
# and thus the standard deviation is sqrt(exp(Xb))
sd <- function(x) {sqrt(exp(5.5+0.042*x))}
curve(sd, col="green", lwd=2)

Is the the green curve the correct estimator of the standard deviation in a Poisson regression? It should be, no?

Best Answer

Poisson regression finds a value $\hat{\beta}$ maximizing the likelihood of the data. For any value of $x$, you would then suppose $Y$ has a Poisson($\exp(x \hat{\beta})$) distribution. The standard deviation of that distribution equals $\exp(x \hat{\beta}/2)$. This appears to be what you mean by $\sqrt{\widehat{\mu}}$.

There are, of course, other ways to estimate the standard deviation of $Y|x$. However, staying within the context of Poisson regression, $\exp(x \hat{\beta}/2)$ is the ML estimator of SD($Y|x$) for the simple reason that the ML estimator of a function of the parameters is the same function of the ML estimator of those parameters. The function in this case is the one sending $\hat{\beta}$ to $\exp(x \hat{\beta}/2)$ (for any fixed value of $x$). This theorem will appear in any full account of maximum likelihood estimation. Its proof is straightforward. Conceptually, the function is a way to re-express the parameters, but re-expressing them doesn't change the fact that they maximize (or fail to maximize, depending on their values) the likelihood.