I am looking for an example to determine the coefficients of a GLM by maximizing the (log)likelihood, preferrably using R. The optimization (search algorithm) is not the problem; this can be done visually by inspecting plots. My key problem is how to calculate the likelihood values.

Consider some count data and a Poisson model.

For the simplest model, the calculation of the likelihood is staight foreward: the sum of the log densities of the poisson distribution and a plot of logLik versus lambda shows the maximum. This is the R solution for Y ~ 1:

n

More Jochen Wilhelm's questions See All
Similar questions and discussions