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.
 
Thread 'Is this public key encryption?'
I've tried to intuit public key encryption but never quite managed. But this seems to wrap it up in a bow. This seems to be a very elegant way of transmitting a message publicly that only the sender and receiver can decipher. Is this how PKE works? No, it cant be. In the above case, the requester knows the target's "secret" key - because they have his ID, and therefore knows his birthdate.
I tried a web search "the loss of programming ", and found an article saying that all aspects of writing, developing, and testing software programs will one day all be handled through artificial intelligence. One must wonder then, who is responsible. WHO is responsible for any problems, bugs, deficiencies, or whatever malfunctions which the programs make their users endure? Things may work wrong however the "wrong" happens. AI needs to fix the problems for the users. Any way to...
Back
Top