MCMC algorithm -- understanding some paremeters

  • Context: Python 
  • Thread starter Thread starter Arman777
  • Start date Start date
  • Tags Tags
    Algorithm
Click For Summary

Discussion Overview

The discussion revolves around understanding specific parameters in a Markov Chain Monte Carlo (MCMC) program, particularly focusing on the Metropolis-Hastings algorithm. Participants are exploring the implications of parameters such as temperature and chain number on the results of the analysis.

Discussion Character

  • Exploratory, Technical explanation, Debate/contested

Main Points Raised

  • One participant seeks clarification on the meaning and implications of parameters like temperature and chain number in the MCMC program.
  • Another participant suggests examining the source code for insights into the parameters, noting a trend in programming to minimize documentation.
  • It is mentioned that temperature is the sampling temperature and that chain number indicates the number of CPUs used, with a specific example of using 4 chains on a system with 2 cores.
  • One participant expresses difficulty in finding documentation or references for the parameters despite attempts to locate them.

Areas of Agreement / Disagreement

Participants appear to have varying levels of understanding regarding the parameters, with some agreeing on their definitions while others express uncertainty or seek further clarification. No consensus is reached on the implications of these parameters.

Contextual Notes

Some participants acknowledge limitations in available documentation and the reliance on embedded comments in the source code, which may not provide comprehensive explanations.

Who May Find This Useful

Individuals interested in MCMC algorithms, particularly those using the Metropolis-Hastings method, as well as programmers seeking to understand parameter implications in computational models.

Arman777
Insights Author
Gold Member
Messages
2,163
Reaction score
191
Recently I have shared a question about a program called SimpleMC and how to run it.

Running a Github File on VS code for windows 10- File system problem ( | Physics Forums

I am trying to understand an MCMC program. I manage to run it, but I am trying to understand the meaning of the some parameters in the analysis.

The code is something like this

Python:
[mcmc]
;Nsamples
nsamp   = 50000

;Burn-in
skip    = 300

;temperature at which to sample
temp    = 2

; Gelman-Rubin for convergence
GRstop  = 0.01

;every number of steps check the GR-criteria
checkGR = 500

;1 if single cpu , otherwise is giving by the nproc-> mpi -np #
chainno = 0

This is for the metropolis-hastings algorithm. How my results depend on these parameters or what these parameters mean ?
I understood the nsamp and skip, I also kind of know what GRstop and checkGR means but I have no idea what temp and chainno means.
 
Last edited:
  • Skeptical
Likes   Reactions: pbuk
Technology news on Phys.org
Perhaps you can find the meaning behind the parameters by looking at where they are referenced in the source code you have.

The current programming paradigm is to skip documentation for the most part unless its going to be used by a lot of people. Instead they will embed comments that give you a hint of what they are used for.
 
  • Like
Likes   Reactions: Arman777
temp is the temperature at which to sample and if chainno is 1 then it will use 1 cpu, or you can set it to a different number.
 
jedishrfu said:
Perhaps you can find the meaning behind the parameters by looking at where they are referenced in the source code you have.

The current programming paradigm is to skip documentation for the most part unless its going to be used by a lot of people. Instead they will embed comments that give you a hint of what they are used for.
I tried but not luck. I have find this MrBayes (sourceforge.net)
 
pbuk said:
temp is the temperature at which to sample and if chainno is 1 then it will use 1 cpu, or you can set it to a different number.
I guess I have 2 cores but I am setting chains = 4 and temp = 0.2 it seems to be working.
 

Similar threads

  • · Replies 14 ·
Replies
14
Views
2K
  • · Replies 2 ·
Replies
2
Views
2K
  • · Replies 3 ·
Replies
3
Views
1K
  • · Replies 17 ·
Replies
17
Views
3K
  • · Replies 16 ·
Replies
16
Views
8K
  • · Replies 12 ·
Replies
12
Views
4K
  • · Replies 1 ·
Replies
1
Views
2K
Replies
12
Views
7K
  • · Replies 10 ·
Replies
10
Views
2K