R/pdarroch.R

Defines functions pdarroch

Documented in pdarroch

pdarroch=function(n1,n2,m2)
{

# POSTERIOR PROBABILITIES OF N FOR THE DARROCH MODEL UNDER UNIFORM PRIOR (N_Max=400)

prob=c(rep(0,max(n1+n2-m2,1)-1),choose(n1,m2)*choose(max((n1+n2-m2),1):400-n1,n2-m2)/choose(max((n1+n2-m2),1):400,n2))
prob/sum(prob)
}

Try the bayess package in your browser

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

bayess documentation built on Aug. 11, 2022, 5:07 p.m.