According to Metropolis-Hasting algorithm, the first sample is an arbitrary value generated randomly at the Initialization step. ( http://en.wikipedia.org/wiki/Metropolis%E2%80%93Hastings_algorithm ) If we know the range of values that is closer to the parameters to-be-estimated is known, this information can be used to reduce the number of iterations.

Thus, why not set the first sample at the Initialization step to the value that are within the range ? How to provide the first sample value to the pymc.MCMC() object instead of allowing pymc to randomly generate an arbitrary first sample value ?

I'm currently using pymc2.2 and failed to install pymc3 to my Windows platform.


Given that the Metropolis-Hastings algorithm is based on the ergodic theorem, i.e., on forgetting the initial condition, the way one picks the initial value is of minor importance. In particular, if some information is available about regions of high probability, the starting point may be chosen in one of those regions.

According to Metropolis-Hasting algorithm, the first sample is an arbitrary value generated randomly at the Initialization step.

Chosen "randomly" means according to an arbitrary measure, which contains as special cases deterministic choices. Starting from a high probability region bypasses burn-in, but does not necessarily accelerate convergence as the mixing behaviour of the chain may be poor notwithstanding the starting point.

  • $\begingroup$ @ Xi, Thanks for the response. What do you think of my following reasoning and please provide your thoughts: If I know the estimated value is located in the regions of high probability and set the this value to be the first sample value in the MH algorithm, then the iterations to find correct estimated value are shorten by eliminating burn ins. This will reduce computational time; say 5 days to 2 days. You’re correct that the possibility of bad mixing but since the sample starts in the regions of high probability, the final value is most probably the good answer. $\endgroup$ – user3460430 May 28 '15 at 17:41
  • $\begingroup$ @Everyone, It seems this is a good idea, so the question will be direct to every one: Does anybody know how to do it with pymc2.2 ? $\endgroup$ – user3460430 May 28 '15 at 17:42
  • $\begingroup$ In PyMC2, you can use the value parameter of the pm.Stochastic class to set initial values, for example, X = pm.Normal('X', 0, 1, value=.1). $\endgroup$ – Abraham D Flaxman May 28 '15 at 23:23
  • $\begingroup$ @user3460430: starting from a high probability value certainly removes the burnin bias. The variance is a function of the proposal so it is not impacted much. $\endgroup$ – Xi'an May 29 '15 at 9:59
  • $\begingroup$ @ Xi, Oh, I didn't know there is an "accept" option until reading your reply. Yes, I've accepted your answer. Thanks for your help. $\endgroup$ – user3460430 May 29 '15 at 22:02

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.