#Four males were draw from a public school. #What are the gender proportions? #-- Inverse probability (?) #Author: Zhiwu Zhang #Last update: April 19, 2016 par(mfrow=c(3,1), mar = c(3,4,1,1)) p=seq(0,1,.01) n=10 k=n pyp=dbinom(k,n,p) theMax=pyp==max(pyp) pMax=p[theMax] plot(p,pyp,type="b",main=paste("Data=", pMax,sep="")) ps=p*10-9 pd=dnorm(ps) theMax=pd==max(pd) pMax=p[theMax] plot(p,pd,type="b",main=paste("Prior=", pMax,sep="")) ppy=pd*pyp theMax=ppy==max(ppy) pMax=p[theMax] plot(p,ppy,type="b",main=paste("Optimum=", pMax,sep=""))