Revision 1058

trunk/src/nh99/model7.cpp (revision 1058)
187 187
      (*ad_printf)( " -mcrb  N        reduce amount of correlation in the covariance matrix 1<=N<=9\n");
188 188
      (*ad_printf)( " -mcnoscale      don't rescale step size for mcmc depending on acceptance rate\n");
189 189
      (*ad_printf)( " -nosdmcmc       turn off mcmc histogram calcs to make mcsave run faster\n");
190
      (*ad_printf)( " -mcgrope N      same as -mcprobe\n");
191 190
      (*ad_printf)( " -mcprobe N      use probing strategy for mcmc with factor N\n");
191
      (*ad_printf)( " -mcgrope N      Deprecated, same as -mcprobe\n");
192 192
      (*ad_printf)( " -mcseed N       seed for random number generator for markov chain monte carlo\n");
193 193
      (*ad_printf)( " -mcscale N      rescale step size for first N evaluations\n");
194 194
      (*ad_printf)( " -mcsave N       save the parameters for every Nth simulation\n");
195 195
      (*ad_printf)( " -mceval         go through the saved mcmc values from a previous mcsave\n");
196
    //(*ad_printf)( " -mcu            use uniformaly distributed steps for mcmc\n");
196
      (*ad_printf)( " -mcu            use uniformaly distributed steps for mcmc instead of random normal\n");
197 197
      (*ad_printf)( " -crit N1,N2,... set gradient magnitude convergence criterion to N\n");
198 198
      (*ad_printf)( " -iprint N       print out function minimizer report every N iterations\n");
199 199
      (*ad_printf)( " -maxfn N1,N2,.. set maximum number opf function eval's to N\n");
trunk/src/nh99/xxmcmc.cpp (revision 1058)
95 95

  
96 96
void ADSleep(int);
97 97

  
98
void function_minimizer::mcmc_routine(int nmcmc,int iseed0,double dscale,
98
/**
99
 * Monte Carlo Markov Chain minimization routine
100
 * Approximate the target distribution by performing a random walk
101
   across parameter space, integrating at each step.
102
 * This routine also parses the command line arguments and performs actions for
103
   the following ones:
104
 * -mcdiag     Use diagonal covariance matrix with covariance = dscale.
105
 * -mcrb N     Modify covariance matrix to reduce high correlations. 1<=N<=9
106
               where 1=10% and 9=90%.
107
 * -mcec       Read in empirical covariance matrix. This is a file with the
108
               program name prepended to extension '.ecm'.
109
 * -mcpin NAME Read in starting values for MCMC from file NAME. NAME must be a
110
               valid ADMB '.par' file.
111
 * -mcscale    Dynamically scales covariance matrix until a reasonable
112
               acceptance rate is observed.
113
 * -nosdmcmc   Turn off calculation os sdreport variables during mcsave phase
114
               (saves a lot of CPU time).
115
 * -mcu        Use uniform multivariate distributions as bounds, if this is not
116
               specified then random normal multivariate distributions will be
117
               used.
118
 * -mcnoscale  Don't rescale step size based on acceptance rate.
119
 * -mcr        Continue MCMC from a previous -mcmc call. Uses '.mcm' file to
120
               accomplish this.
121
 * -mcsave N   Save parameter values from every Nth simulation instead of every
122
               single one.
123
 * -mcprobe N  Use probing strategy, 0.00001<N<=0.499. See the function
124
               new_probing_bounded_multivariate_normal() in prmonte.cpp
125
               for more detail.
126
 * -mcgrope    Deprecated, equivalent to -mcprobe
127
 * \param int nmcmc The number of MCMC simulations to run.
128
 * \param int iseed0 Initial seed value for simulations.
129
 * \param double dscale Scale value used only if -mcdiag is specified.
130
 * \param int restart_flag Restart the MCMC, even if -mcr is specified.
131
 * \return Nothing.
132
 */
133
void function_minimizer::mcmc_routine(int nmcmc,int iseed0, double dscale,
99 134
  int restart_flag)
100
{
135
 {
101 136
  uostream * pofs_psave=NULL;
102 137
  dmatrix mcmc_display_matrix;
103
  //int mcmc_save_index=1; 
138
  //int mcmc_save_index=1;
104 139
  //int mcmc_wrap_flag=0;
105 140
  //int mcmc_gui_length=10000;
106 141
  int no_sd_mcmc=0;
......
474 509
          int iii=atoi(ad_comm::argv[on+1]);
475 510
          if (iii <=0)
476 511
          {
477
            cerr << " Invalid option following command line option -mcball -- "
512
            cerr << " Invalid option following command line option -mcscale -- "
478 513
              << endl << " ignored" << endl;
479 514
          }
480 515
          else
......
605 640
          pprobe=strtod(ad_comm::argv[on+1],&end);
606 641
          if (pprobe<=0.00001 || pprobe > .499) 
607 642
          {
608
            cerr << "Invalid argument to option -mcgrope" << endl;
643
            cerr << "Invalid argument to option -mcprobe" << endl;
609 644
            pprobe=-1.0;
610 645
            probe_flag=0;
611 646
          }
......
887 922
  }
888 923
}
889 924

  
925
/**
926
 * Writes the covariance matrix out to a file, which is prog_name
927
 * prepended to the extension '.ecm'.
928
 * Also writes the sorted eigenvalues of the covariance matrix to the screen.
... This diff was truncated because it exceeds the maximum size that can be displayed.

Also available in: Unified diff