[R] Poisson dpois value is too small for double precision thus corrupts loglikelihood
R_help Help
rhelpacc at gmail.com
Tue Oct 27 01:21:51 CET 2009
Hi - I have a likelihood function that involves sums of two possions:
L = a*dpois(Xi,theta1)*dpois(Yi,theta2)+b*(1-c)*a*dpois(Xi,theta1+theta3)*dpois(Yi,theta2)
where a,b,c,theta1,theta2,theta3 are parameters to be estimated.
(Xi,Yi) are observations. However, Xi and Yi are usually big (>
20000). This causes dpois to returns 0 depending on values of theta1,
theta2 and theta3.
My first question is: is there anyway around this?
My second question is regarding the likelihood function value. Since
dpois returns 0, my log likelihood becomes infinite and causes problem
when optimization. Is there any smart way to avoid this?
Thank you,
rc
More information about the R-help
mailing list