new; "MONTECARLO.GPR: program to do monte carlo study of the finite sample properties of the structural NFXP and semiparametric estimators of the identified parameters of the prisoners dilemma game. John Rust, University of Maryland, November, 2006 "; #include setup.gpr; mctype="semifl"; /* choose mctype = "semi" to study performance of semiparametric estimator (using actual equilibrium probabilities, or "semifl" to do the semiparametric two step estimator with the full likelihood (i.e. invoking symmetry and pooling both prisoner a and b's observations), or mctype="mle" for the full maximum likelihood estimation using the nested fixed point algorithm */ if (mctype $== "semi"); infile="pa"; inlist="pa.lst"; outfile="pa.out"; qsav="pa"; elseif (mctype $== "semifl"); infile="papb_s"; inlist="papb_s.lst"; outfile="papb_s.out"; qsav="papb_s"; else; infile="papb"; inlist="papb.lst"; outfile="papb.out"; qsav="papb"; endif; {iloc,ivar,dvar,dloc,cloc}=select(inlist); nmc=500; /* number of monte carlo runs */ qmc=zeros(nmc,2); smc=zeros(nmc,2); i=1; do until i > nmc; "monte carlo run "$+ftos(i,"-*.*lf",3,0); "generating monte carlo dataset "; genmcdata(mctype,npemeth); if (mctype $== "semi"); {qr,hll}=max(dvar,dloc,ivar,iloc,cloc,q,infile,500,outfile,qsav,&evalblg); elseif (mctype $== "semifl"); {qr,hll}=max(dvar,dloc,ivar,iloc,cloc,q,infile,500,outfile,qsav,&evalblgfl); else; {qr,hll}=max(dvar,dloc,ivar,iloc,cloc,q,infile,500,outfile,qsav,&evalpd); endif; qmc[i,.]=qr'; if (i == 1); hllsave=hll; else; hllsave=hllsave|hll; endif; smc[i,1]=sqrt(hll[1,1]); smc[i,2]=sqrt(hll[2,2]); i=i+1; endo; "monte carlo analysis has been completed. Run denplot.gpr in the graphics version of gauss "; "to graph the results of this monte carlo experiment."; save qmc,smc;