APEMoST

src/markov_chain.h

Go to the documentation of this file.
00001 /*
00002     APEMoST - Automated Parameter Estimation and Model Selection Toolkit
00003     Copyright (C) 2009  Johannes Buchner
00004 
00005     This program is free software: you can redistribute it and/or modify
00006     it under the terms of the GNU General Public License as published by
00007     the Free Software Foundation, either version 3 of the License, or
00008     (at your option) any later version.
00009 
00010     This program is distributed in the hope that it will be useful,
00011     but WITHOUT ANY WARRANTY; without even the implied warranty of
00012     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00013     GNU General Public License for more details.
00014 
00015     You should have received a copy of the GNU General Public License
00016     along with this program.  If not, see <http://www.gnu.org/licenses/>.
00017  */
00018 
00019 #ifndef MCMC_MARKOV_CHAIN_H_
00020 #define MCMC_MARKOV_CHAIN_H_
00021 
00022 #include "mcmc.h"
00023 #include "define_defaults.h"
00024 
00025 #define DEFAULT_ADJUST_STEP 0.5
00026 #ifndef NO_RESCALING_LIMIT
00027 #define NO_RESCALING_LIMIT 15
00028 #endif
00029 
00030 #ifndef ITER_READJUST
00031 #define ITER_READJUST 200
00032 #endif
00033 
00034 #ifndef CIRCULAR_PARAMS
00035 
00045 #define CIRCULAR_PARAMS 0
00046 #endif
00047 
00059 void markov_chain_calibrate(mcmc * m, const unsigned int burn_in_iterations,
00060                 double desired_acceptance_rate, const double max_ar_deviation,
00061                 const unsigned int iter_limit, double mul, const double adjust_step);
00066 void markov_chain_step(mcmc * m);
00072 void markov_chain_step_for(mcmc * m, const unsigned int index);
00073 
00077 void rmw_adapt_stepwidth(mcmc * m, double prob_old);
00078 
00082 void burn_in(mcmc * m, const unsigned int burn_in_iterations);
00083 
00084 #ifndef ACCURACY_DEVIATION_FACTOR
00085 
00090 #define ACCURACY_DEVIATION_FACTOR 0.25
00091 #endif
00092 
00108 unsigned int assess_acceptance_rate(mcmc * m, unsigned int param,
00109                 double desired_acceptance_rate, double min_accuracy,
00110                 double max_accuracy, double * acceptance_rate, double * accuracy);
00111 
00116 void restart_from_best(mcmc * m);
00117 
00118 #endif /* MCMC_MARKOV_CHAIN_H_ */