0001 function ms_write_mhm_input(fname, options_ms)
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018
0019
0020
0021
0022
0023
0024
0025
0026
0027
0028
0029
0030
0031 fh = fopen(fname,'w');
0032
0033
0034 fprintf(fh,'/**********************************************************\n');
0035 fprintf(fh,' *** This input file is read by swzmsbvar_mhm_1 and swzmsbvar_mhm_1.exe only, NOT by swzmsbvar_printdraws.exe.\n');
0036 fprintf(fh,' ***\n');
0037 fprintf(fh,' **********************************************************/\n');
0038
0039 fprintf(fh,'\n\n//------------- 1st set of posterior draws to find optimal scales for Metropolis (30000). ---------------\n');
0040 fprintf(fh,'//== number draws for first burn-in ==// //For determining the Metropolis scales only.\n');
0041 fprintf(fh,'%d\n\n',options_ms.draws_nbr_burn_in_1);
0042
0043 fprintf(fh,'//------------- MCMC burn-in draws once the Metropolis scales (previous stage) are fixed. --------------\n');
0044 fprintf(fh,'//------------- 2nd set of standard burn-in posterior draws to throw away the initial draws (10000). ---------------\n');
0045 fprintf(fh,'//== number draws for second burn-in ==//\n');
0046 fprintf(fh,'%d\n\n',options_ms.draws_nbr_burn_in_2);
0047
0048 fprintf(fh,'//--------------- 1st set of posterior draws to compute the mean and variance for the weighting function in the MHM (200000) ----------------\n');
0049 fprintf(fh,'//== number draws to estimate mean and variance ==//\n');
0050 fprintf(fh,'%d\n\n',options_ms.draws_nbr_mean_var_estimate);
0051
0052 fprintf(fh,'//--------------- Only applied to mhm_2 process: total number of MCMC draws = thinning factor * 2nd set of saved posterior draws ----------------\n');
0053 fprintf(fh,'//== thinning factor for modified harmonic mean process ==//\n');
0054 fprintf(fh,'%d\n\n',options_ms.thinning_factor);
0055
0056 fprintf(fh,'//--------------- 2nd set of saved posterior draws from MHM_2 (second stage): saved draws AFTER thinning (1000000) ----------------\n');
0057 fprintf(fh,'//== number draws for modified harmonic mean process ==//\n');
0058 fprintf(fh,'%d\n\n',options_ms.draws_nbr_modified_harmonic_mean);
0059
0060 fprintf(fh,'//------- 1st stage: computing all three tightness factors for Dirichlet. ---------\n');
0061 fprintf(fh,'//------- 2nd stage: hard-code the second scale factor (in principle, we can do all three). ---------\n');
0062 fprintf(fh,'//------- It seems that Dan''s code only use the first element of the following scales. The scale applies to the Dirichlet''s hyperparameter alpha for the diagonal of the transition matrix in the weighting function. Note that the weighting function for the transition matrix parameters is Dirichlet. ---------\n');
0063
0064 fprintf(fh,'//== scale values for Dirichlet distribution ==//\n');
0065 fprintf(fh,'3\n\n');
0066 fprintf(fh,'%f ',options_ms.dirichlet_scale);
0067 fprintf(fh,'\n');
0068 fclose(fh);