SedSat3 1.1.6
Sediment Source Apportionment Tool - Advanced statistical methods for environmental pollution research
Loading...
Searching...
No Matches
_MCMC_settings Struct Reference

Configuration parameters for Markov Chain Monte Carlo sampling. More...

#include <MCMC/MCMC.h>

Collaboration diagram for _MCMC_settings:
Collaboration graph

Public Attributes

unsigned int total_number_of_samples {}
 Total number of MCMC samples to generate per chain.
unsigned int number_of_chains {}
 Number of parallel MCMC chains to run.
unsigned int burnout_samples {}
 Number of initial samples to discard as burn-in.
double ini_purt_fact = 1
 Initial perturbation factor for proposal distribution.
double perturbation_factor = 0.05
 Perturbation factor for proposal distribution during sampling.
unsigned int number_of_parameters {}
 Number of model parameters to estimate.
int save_interval = 1
 Interval for saving MCMC samples to output.
string continue_filename
 Filename to continue a previous MCMC run.
bool noinipurt {}
 Skip initial random perturbation of starting values.
bool sensbasedpurt {}
 Use sensitivity-based adaptive proposal distribution.
bool global_sensitivity {}
 Perform global sensitivity analysis during MCMC.
bool continue_mcmc = false
 Continue from a previous MCMC run.
unsigned int number_of_post_estimate_realizations {}
 Number of posterior predictive realizations to generate.
double dp_sens {}
 Finite difference step size for sensitivity analysis.
bool noise_realization_writeout {}
 Write out posterior predictive realizations with observation noise.
unsigned int numberOfThreads = 8
 Number of parallel threads for MCMC computation.
double acceptance_rate = 0.15
 Target acceptance rate for Metropolis-Hastings algorithm.
double purt_change_scale = 0.75
 Scale factor for adaptive perturbation adjustment.
bool dissolve_chains = false
 Merge all chains into single posterior sample.
bool covariance_proposal = true
 Covariance-adapted (correlated) proposal, ON by default.
unsigned int covariance_update_interval = 1000
 samples between refreshes
unsigned int covariance_min_samples = 500
 samples needed before the first
double covariance_scale = 2.38
 divided by sqrt(number of parameters)
double covariance_ridge = 1e-8
 relative ridge added to the diagonal

Detailed Description

Configuration parameters for Markov Chain Monte Carlo sampling.

Contains all tuning parameters and settings that control MCMC algorithm behavior, including chain length, burn-in, proposal distribution tuning, and parallelization.

Definition at line 43 of file MCMC.h.

Member Data Documentation

◆ acceptance_rate

double _MCMC_settings::acceptance_rate = 0.15

Target acceptance rate for Metropolis-Hastings algorithm.

Optimal acceptance rate for efficient MCMC sampling. Proposal distribution variance is adaptively tuned to achieve this rate.

Theoretical optimal: ~0.234 for high dimensions, ~0.44 for 1-D Practical default: 0.15 (15%)

Definition at line 210 of file MCMC.h.

◆ burnout_samples

unsigned int _MCMC_settings::burnout_samples {}

Number of initial samples to discard as burn-in.

Initial samples before the chain reaches the stationary distribution are discarded. Typical: 10-50% of total_number_of_samples.

Note
Burn-in samples are not included in posterior statistics

Definition at line 73 of file MCMC.h.

◆ continue_filename

string _MCMC_settings::continue_filename

Filename to continue a previous MCMC run.

If continue_mcmc is true, this file contains the chain state to resume from. Useful for extending chains that haven't converged or adding more samples.

Definition at line 120 of file MCMC.h.

◆ continue_mcmc

bool _MCMC_settings::continue_mcmc = false

Continue from a previous MCMC run.

If true, resume chains from state saved in continue_filename. Allows extending MCMC runs without starting over.

Default: false

Definition at line 160 of file MCMC.h.

◆ covariance_min_samples

unsigned int _MCMC_settings::covariance_min_samples = 500

samples needed before the first

Definition at line 248 of file MCMC.h.

◆ covariance_proposal

bool _MCMC_settings::covariance_proposal = true

Covariance-adapted (correlated) proposal, ON by default.

The diagonal proposal perturbs each parameter independently by pertcoeff[i]. Where the posterior is correlated (source contributions trade off against each other and against the source means), it cannot step along the ridge: the step must suit the narrowest direction, and the chains mix slowly. With covariance_proposal the sampler estimates the covariance of the samples after the burn-in, in log space for log-normal parameters, and proposes correlated steps from it (adaptive Metropolis, Haario, Saksman and Tamminen, 2001), scaled by covariance_scale / sqrt(d) (Roberts and Rosenthal, 2001) times the acceptance-rate adaptation. Ported from OpenHydroQual.

Definition at line 246 of file MCMC.h.

◆ covariance_ridge

double _MCMC_settings::covariance_ridge = 1e-8

relative ridge added to the diagonal

Definition at line 250 of file MCMC.h.

◆ covariance_scale

double _MCMC_settings::covariance_scale = 2.38

divided by sqrt(number of parameters)

Definition at line 249 of file MCMC.h.

◆ covariance_update_interval

unsigned int _MCMC_settings::covariance_update_interval = 1000

samples between refreshes

Definition at line 247 of file MCMC.h.

◆ dissolve_chains

bool _MCMC_settings::dissolve_chains = false

Merge all chains into single posterior sample.

If true, combines samples from all chains after discarding burn-in. If false, keeps chains separate for convergence diagnostics.

Default: false

Definition at line 230 of file MCMC.h.

◆ dp_sens

double _MCMC_settings::dp_sens {}

Finite difference step size for sensitivity analysis.

Fractional change in parameter value for numerical derivative calculation. Typical: 0.001-0.01 (0.1%-1% of parameter value)

Definition at line 179 of file MCMC.h.

◆ global_sensitivity

bool _MCMC_settings::global_sensitivity {}

Perform global sensitivity analysis during MCMC.

If true, calculates parameter sensitivity at sampled points to assess which parameters most influence model predictions.

Default: false (sensitivity analysis disabled)

Definition at line 150 of file MCMC.h.

◆ ini_purt_fact

double _MCMC_settings::ini_purt_fact = 1

Initial perturbation factor for proposal distribution.

Controls the size of initial random perturbations when starting chains. Larger values explore more broadly initially. Default: 1.0

Definition at line 82 of file MCMC.h.

◆ noinipurt

bool _MCMC_settings::noinipurt {}

Skip initial random perturbation of starting values.

If true, chains start exactly at provided initial values without random jitter. If false, initial values are randomly perturbed within parameter ranges.

Default: false (apply initial perturbation)

Definition at line 130 of file MCMC.h.

◆ noise_realization_writeout

bool _MCMC_settings::noise_realization_writeout {}

Write out posterior predictive realizations with observation noise.

If true, saves model predictions including simulated measurement errors. Useful for assessing prediction uncertainty including observational uncertainty.

Default: false

Definition at line 189 of file MCMC.h.

◆ number_of_chains

unsigned int _MCMC_settings::number_of_chains {}

Number of parallel MCMC chains to run.

Running multiple chains allows:

  • Convergence diagnostics (Gelman-Rubin statistic)
  • Detection of multimodal posteriors
  • Parallel computation speedup

Typical value: 3-8 chains

Definition at line 63 of file MCMC.h.

◆ number_of_parameters

unsigned int _MCMC_settings::number_of_parameters {}

Number of model parameters to estimate.

Dimensionality of the parameter space. For sediment fingerprinting, this typically equals the number of sources being apportioned.

Definition at line 102 of file MCMC.h.

◆ number_of_post_estimate_realizations

unsigned int _MCMC_settings::number_of_post_estimate_realizations {}

Number of posterior predictive realizations to generate.

After MCMC completes, this many realizations of model predictions are generated by sampling from the posterior parameter distribution. Used for uncertainty propagation and prediction intervals.

Typical: 1000-10,000

Definition at line 171 of file MCMC.h.

◆ numberOfThreads

unsigned int _MCMC_settings::numberOfThreads = 8

Number of parallel threads for MCMC computation.

Chains can be run in parallel across multiple threads for speedup. Should not exceed number of physical CPU cores.

Default: 8

Definition at line 199 of file MCMC.h.

◆ perturbation_factor

double _MCMC_settings::perturbation_factor = 0.05

Perturbation factor for proposal distribution during sampling.

Controls the standard deviation of proposal distribution as fraction of parameter range. Smaller values = smaller steps = higher acceptance rate but slower mixing.

Typical: 0.01-0.1 Default: 0.05 (5% of parameter range)

Definition at line 94 of file MCMC.h.

◆ purt_change_scale

double _MCMC_settings::purt_change_scale = 0.75

Scale factor for adaptive perturbation adjustment.

When acceptance rate deviates from target, perturbation factor is multiplied/divided by this value to bring acceptance rate closer to target.

Default: 0.75 (aggressive tuning)

Definition at line 220 of file MCMC.h.

◆ save_interval

int _MCMC_settings::save_interval = 1

Interval for saving MCMC samples to output.

Save every nth sample to reduce file size and memory usage. save_interval=1 saves every sample, save_interval=10 saves every 10th.

Default: 1 (save all samples)

Definition at line 112 of file MCMC.h.

◆ sensbasedpurt

bool _MCMC_settings::sensbasedpurt {}

Use sensitivity-based adaptive proposal distribution.

If true, proposal variance is adapted based on parameter sensitivity, allowing larger steps for less sensitive parameters.

Default: false

Definition at line 140 of file MCMC.h.

◆ total_number_of_samples

unsigned int _MCMC_settings::total_number_of_samples {}

Total number of MCMC samples to generate per chain.

The total chain length including burn-in. Typical values: 10,000-100,000+ depending on parameter dimensionality and convergence speed.

Definition at line 51 of file MCMC.h.


The documentation for this struct was generated from the following file: