APEMoST

src/parallel_tempering_beta.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 _PARALLEL_TEMPERING_BETA_H
00020 #define _PARALLEL_TEMPERING_BETA_H
00021 #include <gsl/gsl_sf.h>
00022 
00023 #include "mcmc.h"
00024 #include "parallel_tempering.h"
00025 #include "parallel_tempering_interaction.h"
00026 
00027 void set_beta(mcmc * m, double newbeta);
00028 double get_beta(const mcmc * m);
00029 void inc_swapcount(mcmc * m);
00030 unsigned long get_swapcount(const mcmc * m);
00031 void print_current_positions(const mcmc ** chains, const int n_beta);
00032 
00033 #ifdef __NEVER_SET_FOR_DOCUMENTATION_ONLY
00034 
00049 #define BETA_ALIGNMENT
00050 #endif
00051 
00052 #ifndef BETA_ALIGNMENT
00053 #define BETA_ALIGNMENT chebyshev_beta
00054 #endif
00055 
00056 double get_chain_beta(unsigned int i, unsigned int n_beta, double beta_0);
00057 
00061 #define BETA_0_STEPWIDTH 1.0
00062 
00063 double calc_beta_0(mcmc * m, gsl_vector * stepwidth_factors);
00064 
00065 typedef struct {
00069         double beta;
00070 
00074         unsigned long swapcount;
00075 
00076 } parallel_tempering_mcmc;
00077 
00078 void set_beta(mcmc * m, const double newbeta);
00079 
00080 double get_beta(const mcmc * m);
00081 
00082 void inc_swapcount(mcmc * m);
00083 
00084 unsigned long get_swapcount(const mcmc * m);
00085 
00086 #endif
00087