APEMoST
Defines | Functions

src/mcmc_gettersetter.c File Reference

#include "mcmc.h"
#include "gsl_helper.h"
#include <gsl/gsl_rng.h>
#include <gsl/gsl_randist.h>
#include <gsl/gsl_sf.h>

Defines

#define N_PARAMETERS
#define get_n_par(m)   N_PARAMETERS
#define PROPOSAL

Functions

unsigned long get_params_accepts_sum (const mcmc *m)
unsigned long get_params_rejects_sum (const mcmc *m)
unsigned long get_params_accepts_for (const mcmc *m, const unsigned int i)
unsigned long get_params_rejects_for (const mcmc *m, const unsigned int i)
double get_accept_rate_for (const mcmc *m, const unsigned int i)
unsigned long get_params_accepts_global (const mcmc *m)
unsigned long get_params_rejects_global (const mcmc *m)
double get_accept_rate_global (const mcmc *m)
gsl_vector * get_vector_from_array (const unsigned long *array, const unsigned int size)
gsl_vector * get_accept_rate (const mcmc *m)
const char ** get_params_descr (const mcmc *m)
void inc_params_accepts_for (mcmc *m, const unsigned int i)
void inc_params_rejects_for (mcmc *m, const unsigned int i)
void inc_params_accepts (mcmc *m)
void inc_params_rejects (mcmc *m)
void set_params_accepts_for (mcmc *m, const long new_params_accept, const unsigned int i)
void set_params_rejects_for (mcmc *m, const long new_params_reject, const unsigned int i)
void reset_accept_rejects (mcmc *m)
void set_prob_best (mcmc *m, const double new_prob_best)
double get_prob (const mcmc *m)
double get_prior (const mcmc *m)
double get_prob_best (const mcmc *m)
void set_minmax_for (mcmc *m, const double new_min, const double new_max, const unsigned int i)
void set_steps_for (mcmc *m, const double new_step, const unsigned int i)
void set_steps_for_normalized (mcmc *m, const double new_step, const unsigned int i)
void set_params_best (mcmc *m, const gsl_vector *new_params_best)
void set_params_for (mcmc *m, const double new_param, const unsigned int i)
gsl_vector * get_params (const mcmc *m)
double get_params_for (const mcmc *m, const unsigned int i)
gsl_vector * get_params_min (const mcmc *m)
double get_params_min_for (const mcmc *m, const unsigned int i)
gsl_vector * get_params_max (const mcmc *m)
double get_params_max_for (const mcmc *m, const unsigned int i)
gsl_vector * get_params_best (const mcmc *m)
double get_params_best_for (const mcmc *m, const unsigned int i)
void set_params (mcmc *m, gsl_vector *new_params)
void set_params_descr_all (mcmc *m, const char **new_par_descr)
void set_params_descr_for (mcmc *m, const char *new_par_descr, const unsigned int i)
gsl_rng * get_random (const mcmc *m)
void set_random (mcmc *m, gsl_rng *newrandom)
void set_prob (mcmc *m, const double new_prob)
void set_prior (mcmc *m, const double new_prior)
const gsl_matrix * get_data (const mcmc *m)
void set_data (mcmc *m, const gsl_matrix *new_data)
gsl_vector * get_steps (const mcmc *m)
double get_steps_for (const mcmc *m, const unsigned int i)
double get_steps_for_normalized (const mcmc *m, const unsigned int i)
void free_gsl_vector_array (gsl_vector **arr)
void set_steps_all (mcmc *m, const double *new_steps)
double get_next_uniform_plusminus_random (const mcmc *m)
double get_next_uniform_random (const mcmc *m)
double get_next_random_jump (const mcmc *m, const double sigma)
double get_next_alog_urandom (const mcmc *m)

Define Documentation

#define get_n_par (   m)    N_PARAMETERS
#define N_PARAMETERS

Fix the number of parameters to the given value

Setting this might leads the compiler to more optimization. If in doubt, do not set, as your program then can be used for any problems regardless of number of parameters.

my favorite trick: automatically count the lines in the current file CCFLAGS="-DN_PARAMETERS="$(cat params|wc -l)"

Referenced by check().

#define PROPOSAL

Function Documentation

void free_gsl_vector_array ( gsl_vector **  arr)
gsl_vector* get_accept_rate ( const mcmc m)
double get_accept_rate_for ( const mcmc m,
const unsigned int  i 
)
double get_accept_rate_global ( const mcmc m)
const gsl_matrix* get_data ( const mcmc m)

References mcmc::data.

double get_next_alog_urandom ( const mcmc m)

get next random number (logarithmic uniformly distributed between -inf and 0)

References get_next_uniform_random().

Referenced by test_random().

double get_next_random_jump ( const mcmc m,
const double  sigma 
)

get next random number (distributed by the proposal distribution)

You can choose a proposal distribution. The default is a gaussian distribution.

Set PROPOSAL_LOGISTIC, PROPOSAL_UNIFORM if you want to use a different proposal distribution.

References get_random().

Referenced by do_step_for().

double get_next_uniform_plusminus_random ( const mcmc m)

get next random number (uniformly distributed between -1 and 1)

References get_next_uniform_random().

double get_next_uniform_random ( const mcmc m)
gsl_vector* get_params ( const mcmc m)
unsigned long get_params_accepts_for ( const mcmc m,
const unsigned int  i 
)
unsigned long get_params_accepts_global ( const mcmc m)
unsigned long get_params_accepts_sum ( const mcmc m)

References get_n_par, and mcmc::params_accepts.

Referenced by adapt().

gsl_vector* get_params_best ( const mcmc m)
double get_params_best_for ( const mcmc m,
const unsigned int  i 
)

References mcmc::params_best.

const char** get_params_descr ( const mcmc m)
double get_params_for ( const mcmc m,
const unsigned int  i 
)

References mcmc::params.

Referenced by calc_model(), and write_calibrations_file().

gsl_vector* get_params_max ( const mcmc m)

References mcmc::params_max.

Referenced by calc_beta_0(), and write_params_file().

double get_params_max_for ( const mcmc m,
const unsigned int  i 
)
gsl_vector* get_params_min ( const mcmc m)

References mcmc::params_min.

Referenced by calc_beta_0(), and write_params_file().

double get_params_min_for ( const mcmc m,
const unsigned int  i 
)
unsigned long get_params_rejects_for ( const mcmc m,
const unsigned int  i 
)

References mcmc::params_rejects.

Referenced by get_accept_rate_for().

unsigned long get_params_rejects_global ( const mcmc m)

References mcmc::reject.

Referenced by dump(), and get_accept_rate_global().

unsigned long get_params_rejects_sum ( const mcmc m)

References get_n_par, and mcmc::params_rejects.

Referenced by adapt().

double get_prior ( const mcmc m)

References mcmc::prior.

Referenced by calc_model(), main(), and run_sampler().

double get_prob ( const mcmc m)
double get_prob_best ( const mcmc m)
gsl_rng* get_random ( const mcmc m)
gsl_vector* get_steps ( const mcmc m)
double get_steps_for ( const mcmc m,
const unsigned int  i 
)
double get_steps_for_normalized ( const mcmc m,
const unsigned int  i 
)
gsl_vector* get_vector_from_array ( const unsigned long *  array,
const unsigned int  size 
)

References assert.

Referenced by get_accept_rate().

void inc_params_accepts ( mcmc m)
void inc_params_accepts_for ( mcmc m,
const unsigned int  i 
)
void inc_params_rejects ( mcmc m)
void inc_params_rejects_for ( mcmc m,
const unsigned int  i 
)
void reset_accept_rejects ( mcmc m)
void set_data ( mcmc m,
const gsl_matrix *  new_data 
)

References mcmc::data.

Referenced by prepare_and_run_sampler().

void set_minmax_for ( mcmc m,
const double  new_min,
const double  new_max,
const unsigned int  i 
)
void set_params ( mcmc m,
gsl_vector *  new_params 
)
void set_params_accepts_for ( mcmc m,
const long  new_params_accept,
const unsigned int  i 
)

References mcmc::params_accepts.

Referenced by reset_accept_rejects().

void set_params_best ( mcmc m,
const gsl_vector *  new_params_best 
)
void set_params_descr_all ( mcmc m,
const char **  new_par_descr 
)

References mcmc::params_descr.

void set_params_descr_for ( mcmc m,
const char *  new_par_descr,
const unsigned int  i 
)

References mcmc::params_descr.

void set_params_for ( mcmc m,
const double  new_param,
const unsigned int  i 
)
void set_params_rejects_for ( mcmc m,
const long  new_params_reject,
const unsigned int  i 
)

References mcmc::params_rejects.

Referenced by reset_accept_rejects().

void set_prior ( mcmc m,
const double  new_prior 
)

References mcmc::prior.

Referenced by calc_model().

void set_prob ( mcmc m,
const double  new_prob 
)

References mcmc::prob.

Referenced by calc_model(), and restart_from_best().

void set_prob_best ( mcmc m,
const double  new_prob_best 
)

References mcmc::prob_best.

void set_random ( mcmc m,
gsl_rng *  newrandom 
)

References mcmc::random.

void set_steps_all ( mcmc m,
const double *  new_steps 
)

References get_n_par, and set_steps_for().

void set_steps_for ( mcmc m,
const double  new_step,
const unsigned int  i 
)
void set_steps_for_normalized ( mcmc m,
const double  new_step,
const unsigned int  i 
)