MCMC algorithm -- understanding some paremeters

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

The discussion focuses on understanding parameters in the MCMC algorithm, specifically within the SimpleMC program. Key parameters include 'nsamp' set to 50,000, 'skip' at 300, 'temp' indicating the sampling temperature, and 'GRstop' for convergence criteria at 0.01. The 'chainno' parameter determines CPU usage, with a value of 1 indicating single CPU usage. The user successfully runs the algorithm with 4 chains and a temperature of 0.2, demonstrating the flexibility of these parameters in optimizing performance.

PREREQUISITES
  • Understanding of MCMC algorithms
  • Familiarity with the Metropolis-Hastings algorithm
  • Basic knowledge of parameter tuning in statistical models
  • Experience with running code in VS Code on Windows 10
NEXT STEPS
  • Research the implications of 'temperature' in MCMC sampling
  • Learn about the Gelman-Rubin diagnostic for convergence in MCMC
  • Explore parallel processing in MCMC using multiple chains
  • Investigate the SimpleMC program's source code for deeper insights
USEFUL FOR

Data scientists, statisticians, and researchers working with MCMC algorithms, particularly those utilizing the SimpleMC program for statistical analysis and parameter optimization.

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
7K
  • · Replies 12 ·
Replies
12
Views
4K
  • · Replies 1 ·
Replies
1
Views
2K
Replies
12
Views
7K
  • · Replies 10 ·
Replies
10
Views
2K