function [dmL,dmH, J, cvL, cvH]= cc_dm_test %CC_DM_TEST produces the denHaan-Marcet (RES, 1994) accuracy test %load kapa_p1 load 1000_50 J=1000; %number of simulations of the model dmH = 0; %Percentage of the J simulations producing a value of the denHaan-Marcet statistic smaller than the critical value at which the chi-square cumulative distribution reaches 5 percent dmL = 0; %Percentage of the J simulations producing a value of the denHaan-Marcet statistic larger than the critical value at which the chi-square cumulative distribution reaches 95 percent cvH=19.67; %prob(x>19.67)=0.05 chi^2 (11 degrees of freedom) cvL=4.57; ;%prob(x<4.57)=0.05 chi^2 (11 degrees of freedom) for j=1:J dm = cc_simu(zL, zH, DL, DH, aL, aH, n, RSTAR, SIG, OMEGA, BETTA1, ALFA, PAIZ, KAPA, Kss,QQss); dmH = dmH + (dm>cvH)/J; %prob(x>19.67)=0.05 chi^2 11 df dmL = dmL + (dm