Displaying 1 result from an estimated 1 matches for "kolm1".
Did you mean:
kol1
2004 Jan 15
1
Exactness of ppois
...distance between two methods to
## determine P(Poisson(lambda)<=x)
Kolm.dist <- function(lam, eps){
x <- seq(0,qpois(1-eps, lambda=lam), by=1)
max(abs(ppois(x, lambda=lam)-cumsum(dpois(x, lambda=lam))))
}
erg<-optimize(Kolm.dist, lower=900, upper=1000, maximum=TRUE, eps=1e-15)
erg
Kolm1.dist <- function(lam, eps){
x <- seq(0,qpois(1-eps, lambda=lam), by=1)
which.max(abs(ppois(x, lambda=lam)-cumsum(dpois(x, lambda=lam))))
}
Kolm1.dist(lam=erg$max, eps=1e-15)
So for lambda=977.8 and x=1001 we get a distance of about 5.2e-06.
(This inexactness seems to hold for all lambda...