R/dp.post.est.R

Defines functions dp.post.est

Documented in dp.post.est

dp.post.est <- 
function(x,y,alpha, lambda=mean(y))
{
n<-length(y)
c1 <- alpha/(alpha+n) 
c2 <- n/(alpha+n)
post.pmf <- rep(0, length(x))
for(i in 1:length(x)) {
post.pmf[i] <- c1* dpois(x[i],lambda) + c2 * (1/n) * sum(y==x[i])
}
post.pmf
}

Try the rmp package in your browser

Any scripts or data that you put into this service are public.

rmp documentation built on Aug. 25, 2023, 9:06 a.m.