/* SETPARM.G: Procedure to set parameters of a Dirichlet posterior distribution by generating simulated draws of a multinomial and updating the prior to a posterior. John Rust, Yale University, April 1997 */ proc (3)=setparm(n); local i,a,theta,cnts,ind; let theta=.1 .2 .4 .3; let a=3 1 4 4; cnts=zeros(rows(a),1); i=1; do until i > n; ind=maxindc((rndu(1,1).