6

I have a data set $Y$, $Y$ is assumed to follow a poisson distribution with mean = $\lambda$ .

However, each element $y_i$ in $Y$ is accompanied with a covariate $x_i$. So here I want to use poisson regression to model this dataset. The link function is assumed to be log($\lambda(i)$)=$\beta_0$+$\beta_1x_i$.

I then want to use glm(Y~X,family='poisson') to fit the model and get $\beta_0$ and $\beta_1$.

After get $\beta_0$ and $\beta_1$, can I calculate the probability mass function given new $y$ and $x$.

I want to know if all of my above thought make sense?

kjetil b halvorsen
  • 63,378
  • 26
  • 142
  • 467
user22062
  • 1,319
  • 3
  • 15
  • 21
  • 3
    Besides the fact that a conditional Poisson distribution (conditional on x) does not imply a marginal Poisson distribution, this would seem to be exactly the idea of Poisson regression, yes. – Nick Sabbe May 10 '13 at 15:51

2 Answers2

3

If the probability model for $Y$ is this:

$$P(Y_i=y) = \exp(\lambda_i) {\lambda_i}^y / y!$$

and $i$-th observations rate parameter is in fact given by:

$$ \log(\lambda_i) = \beta_0 + \beta_1 x_i$$

(with no model misspecification per others' comments here)

Then the answer is yes you can calculate the PMF for a new $Y$ observation with a given $X$.

So if $X_i=x$, $$P(Y_i=y) = \exp(\exp(\beta_0 + \beta_1 x)) \exp(\beta_0 + \beta_1 x)^y / y!$$

If, however, the new $X$ observation is not known, then the marginal $Y$ distribution is a complex mixture of Poisson RVs.

kjetil b halvorsen
  • 63,378
  • 26
  • 142
  • 467
AdamO
  • 52,330
  • 5
  • 104
  • 209
2

Partially answered in comments:

Besides the fact that a conditional Poisson distribution (conditional on $x$) does not imply a marginal Poisson distribution, this would seem to be exactly the idea of Poisson regression, yes. – Nick Sabbe

For more information on Poisson regression, see Scaling vs Offsetting in Quasi-Poisson GLM

kjetil b halvorsen
  • 63,378
  • 26
  • 142
  • 467
  • 1
    If you used quasilikelihood you would not in fact be able to get a pmf, it should be said. – AdamO Sep 28 '18 at 14:23