Python MCMC algorithm -- understanding some paremeters

  • Thread starter Thread starter Arman777
  • Start date Start date
  • Tags Tags
    Algorithm
AI Thread 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.
 
Dear Peeps I have posted a few questions about programing on this sectio of the PF forum. I want to ask you veterans how you folks learn program in assembly and about computer architecture for the x86 family. In addition to finish learning C, I am also reading the book From bits to Gates to C and Beyond. In the book, it uses the mini LC3 assembly language. I also have books on assembly programming and computer architecture. The few famous ones i have are Computer Organization and...
I have a quick questions. I am going through a book on C programming on my own. Afterwards, I plan to go through something call data structures and algorithms on my own also in C. I also need to learn C++, Matlab and for personal interest Haskell. For the two topic of data structures and algorithms, I understand there are standard ones across all programming languages. After learning it through C, what would be the biggest issue when trying to implement the same data...
Back
Top