Displaying 1 result from an estimated 1 matches for "dskellam".
Did you mean:
skellam
2009 Nov 09
0
unexpected results involving the skellam distribution
...me??
require(skellam)
n <- 5000
lam1 <- 5.45
lam2 <- 2.78
p1 <- rpois(n, lam1)
p2 <- rpois(n, lam2)
rho <- cor(p1,p2)
z <- hist(p1-p2, plot=FALSE)
mu1 <- lam1 - (rho*sqrt(lam1*lam2))
mu2 <- lam2 - (rho*sqrt(lam1*lam2))
x <- z$breaks[1:length(z$breaks)-1]
y <- dskellam(x, mu1, mu2)
plot(x,z$density-y)
--
Cheers.
Ernest