Python MCMC algorithm -- understanding some paremeters

  • Thread starter Thread starter Arman777
  • Start date Start date
  • Tags Tags
    Algorithm
Click For Summary
The discussion revolves around understanding parameters in the MCMC program SimpleMC, specifically focusing on the Metropolis-Hastings algorithm. Key parameters include nsamp (number of samples), skip (burn-in period), GRstop (Gelman-Rubin convergence criterion), and checkGR (steps to check GR-criteria). The temperature parameter (temp) is crucial for sampling, while chainno indicates the number of CPUs used, with a setting of 1 for single CPU operation. The user has experimented with different values for temp and chainno, finding that setting chains to 4 and temp to 0.2 yields successful results. Understanding these parameters is essential for effective analysis in MCMC applications.
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:
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.
 
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
5K
  • · Replies 12 ·
Replies
12
Views
3K
  • · Replies 1 ·
Replies
1
Views
2K
Replies
12
Views
6K
Replies
10
Views
2K