APEMoST
|
#include <string.h>
#include <stdio.h>
#include <math.h>
#include <gsl/gsl_linalg.h>
#include "mcmc.h"
#include "mcmc_internal.h"
#include "debug.h"
#include "gsl_helper.h"
Defines | |
#define | BETWEEN(x, min, max) ( (x) >= (min) && (x) <= (max) ) |
#define | MAX(a, b) ((a) > (b) ? a : b) |
#define | MIN(a, b) ((a) < (b) ? a : b) |
#define | MAX_ACCURACY_IMPROVEMENT 2.8 |
#define | SCALE_LIN_WORST 5 |
#define | SCALE_MIN 0.4 |
Functions | |
void | markov_chain_calibrate_multilinear_regression (mcmc *m, double desired_acceptance_rate, const double max_ar_deviation, const unsigned int iter_limit, double mul, const double adjust_step) |
void | markov_chain_calibrate_linear_regression (mcmc *m, double desired_acceptance_rate, const double max_ar_deviation, const unsigned int iter_limit, gsl_matrix *all_stepwidths, gsl_matrix *all_acceptance_rates, gsl_matrix *all_accuracies) |
void | markov_chain_calibrate_quadratic (mcmc *m, double desired_acceptance_rate, const double max_ar_deviation, const unsigned int iter_limit, double mul, const double adjust_step) |
void | markov_chain_calibrate_alt (mcmc *m, double desired_acceptance_rate, const double max_ar_deviation, const unsigned int iter_limit, double mul, const double adjust_step) |
void | markov_chain_calibrate_orig (mcmc *m, double rat_limit, const double max_rat_deviation, const unsigned int iter_limit, double mul, const double adjust_step) |
void | markov_chain_calibrate (mcmc *m, const unsigned int burn_in_iterations, double desired_acceptance_rate, const double max_ar_deviation, const unsigned int iter_limit, double mul, const double adjust_step) |
#define BETWEEN | ( | x, | |
min, | |||
max | |||
) | ( (x) >= (min) && (x) <= (max) ) |
Referenced by markov_chain_calibrate_quadratic().
#define MAX | ( | a, | |
b | |||
) | ((a) > (b) ? a : b) |
#define MAX_ACCURACY_IMPROVEMENT 2.8 |
Referenced by markov_chain_calibrate_alt().
#define MIN | ( | a, | |
b | |||
) | ((a) < (b) ? a : b) |
Referenced by markov_chain_calibrate_quadratic().
#define SCALE_LIN_WORST 5 |
Referenced by markov_chain_calibrate_alt().
#define SCALE_MIN 0.4 |
Referenced by markov_chain_calibrate_alt().
void markov_chain_calibrate | ( | mcmc * | m, |
const unsigned int | burn_in_iterations, | ||
double | desired_acceptance_rate, | ||
const double | max_ar_deviation, | ||
const unsigned int | iter_limit, | ||
double | mul, | ||
const double | adjust_step | ||
) |
create/calibrate the markov-chain
m | |
desired_acceptance_rate | average acceptance rates for individual parameters to be achieved |
max_ar_deviation | allowed deviation from desired_acceptance_rate |
burn_in_iterations | number of burn-in iterations |
iter_limit | number of iterations for step width calibration |
mul | factor for adjusting the step width during calibration |
adjust_step | gives the factor with which to adjust the stepwidths after burn-in |
References burn_in(), dump_d, markov_chain_calibrate_alt(), markov_chain_calibrate_multilinear_regression(), markov_chain_calibrate_orig(), and markov_chain_calibrate_quadratic().
Referenced by calibrate_first(), and calibrate_rest().
void markov_chain_calibrate_alt | ( | mcmc * | m, |
double | desired_acceptance_rate, | ||
const double | max_ar_deviation, | ||
const unsigned int | iter_limit, | ||
double | mul, | ||
const double | adjust_step | ||
) |
References abs_double, assert, assess_acceptance_rate(), dump_v, get_n_par(), get_params(), get_steps_for(), get_steps_for_normalized(), MAX_ACCURACY_IMPROVEMENT, SCALE_LIN_WORST, SCALE_MIN, and set_steps_for().
Referenced by markov_chain_calibrate().
void markov_chain_calibrate_linear_regression | ( | mcmc * | m, |
double | desired_acceptance_rate, | ||
const double | max_ar_deviation, | ||
const unsigned int | iter_limit, | ||
gsl_matrix * | all_stepwidths, | ||
gsl_matrix * | all_acceptance_rates, | ||
gsl_matrix * | all_accuracies | ||
) |
References abs_double, assert, assess_acceptance_rate(), debug, get_n_par(), IFDEBUG, MAX, and set_steps_for_normalized().
Referenced by markov_chain_calibrate_quadratic().
void markov_chain_calibrate_multilinear_regression | ( | mcmc * | m, |
double | desired_acceptance_rate, | ||
const double | max_ar_deviation, | ||
const unsigned int | iter_limit, | ||
double | mul, | ||
const double | adjust_step | ||
) |
References abs_double, assess_acceptance_rate(), calc_deviation(), dump_v, get_n_par(), get_random(), get_steps(), get_steps_for_normalized(), IFDEBUG, linreg_n(), MAX, and set_steps_for_normalized().
Referenced by markov_chain_calibrate().
void markov_chain_calibrate_orig | ( | mcmc * | m, |
double | rat_limit, | ||
const double | max_rat_deviation, | ||
const unsigned int | iter_limit, | ||
double | mul, | ||
const double | adjust_step | ||
) |
References abs_double, assert, debug, dump_d, dump_i, dump_ul, dump_v, get_accept_rate(), get_accept_rate_global(), get_n_par(), get_params(), get_params_descr(), get_steps(), get_steps_for(), get_steps_for_normalized(), IFDEBUG, ITER_READJUST, markov_chain_step(), markov_chain_step_for(), mcmc_check_best(), NO_RESCALING_LIMIT, mcmc::params_max, mcmc::params_min, mcmc::params_step, reset_accept_rejects(), restart_from_best(), set_steps_for(), set_steps_for_normalized(), and TARGET_ACCEPTANCE_RATE.
Referenced by markov_chain_calibrate().
void markov_chain_calibrate_quadratic | ( | mcmc * | m, |
double | desired_acceptance_rate, | ||
const double | max_ar_deviation, | ||
const unsigned int | iter_limit, | ||
double | mul, | ||
const double | adjust_step | ||
) |
break condition:
References abs_double, assess_acceptance_rate(), BETWEEN, get_n_par(), get_steps_for_normalized(), IFDEBUG, markov_chain_calibrate_linear_regression(), MAX, max_column(), MIN, min_column(), and set_steps_for_normalized().
Referenced by markov_chain_calibrate().