Displaying 1 result from an estimated 1 matches for "pln1".
Did you mean:
pin1
2004 Mar 02
2
Problem with Integrate
...n to
some data. This is a way of modelling species abundances:
N ~ Pois(lam)
log(lam) ~ N(mu, sigma2)
The number of individuals are Poisson distributed with an abundance
drawn from a log-normal distrbution.
To fit this to data, I need to integrate out lam. In principle, I can
do it this way:
PLN1 <- function(lam, Count, mu, sigma2) {
dpois(Count, exp(lam), log=F)*dnorm(LL, mu, sqrt(sigma2))
}
and integrate between -Inf and Inf. For example, with mu=2, and
sigma2=2.8 (which are roughly right for the data), and Count=73, I get this:
> integrate(PLN1, -10, 10, Count=73, mu=2, sig...