need help in glm
Since you have a closed-form expression for the likelihood, you can use optim() [base package] directly, or use mle [stats4], or mle2 [bbmle].
hossain zamani wrote:
Dear all, I am a R using. I have a mixed Poisson regression. my function is: ## P(N=k)=[(a+2)/a ](lambda^k)*[((a+2/a+1)+lambda)^(-k-1)-(a+2+lambda)^(-k-1)]; lambda=a0+a1*x1+a2*x2 and I've attached in a pdf file also.This is a poisson mixed with a weighted exponential distribution in the case that E(theta)=1(theta=random.effect). in fact this model is same as a Poisson-inverse gaussian or Poisson-lognormal regression.I want to estimate the parameters by fitting this model on my data and then compare with Poisson regression(glm).Which package in R can be used. with the best wishes Zamani.H
Ben Bolker Associate professor, Biology Dep't, Univ. of Florida bolker at ufl.edu / www.zoology.ufl.edu/bolker GPG key: www.zoology.ufl.edu/bolker/benbolker-publickey.asc