I have a proposal distribution for one parameter theta_guess

theta_guess = guessleft(theta_accept(1,r-1), 0.01,0)

which is a left truncated normal (and thus non-symmetric) with inputs and output given by:


where mu is the mean, sigma is the std. deviation and a is the lower bound. Moreover, theta_accept(1,r-1) is last period's accepted theta because r is the iteration counter and theta_accept is a 1 x R vector (where R is the number of iterations to run in the M-H loop).

I want to create a correction factor for the acceptance ratio. I am not sure however how to do it. I've tried:

c=truncated_normal_a(theta_guess,theta_accept(1,r-1), 0.01,0)/...
  truncated_normal_a(theta_accept(1,r-1),theta_guess, 0.01,0)

which is of course one. My problem is that I have two parameters, mu and sigma. sigma is fixed, but mu is not in the proposal since it depends on the last period's accepted parameter. So I have no idea what to put in mu's place when creating my correction factor.

  • $\begingroup$ The ratio of the truncated normal is not one because of the normalising constants. $\endgroup$
    – Xi'an
    Commented May 11, 2018 at 9:46
  • $\begingroup$ It's strange to ask for a truncated proposal distribution, instead of limiting the estimated parameter to be non-negative(e.g. weight, height). If the new proposed parameter is always higher than the current value, the sampling space is very much dependent on the initial value and might not converge or only find a local mode. $\endgroup$ Commented Jun 12, 2020 at 13:50

1 Answer 1


If a Metropolis-Hastings algorithm uses a truncated Normal as proposal$${\cal N}^+(\mu_{t-1},\sigma^2)$$the associated Metropolis-Hastings acceptance ratio is $$\dfrac{\pi(\mu')}{\pi(\mu_{t-1})}\times \dfrac{\varphi(\{\mu_{t-1}-\mu'\}/\sigma)}{\varphi(\{\mu'-\mu_{t-1}\}/\sigma)}\times\dfrac{\Phi(\mu_{t-1}/\sigma)}{\Phi(\mu'/\sigma)}$$when $\mu'\sim{\cal N}^+(\mu_{t-1},\sigma^2)$ is the proposed value and $\pi$ denotes the target of the simulation (e.g., the posterior distribution). This ratio simplifies into $$\dfrac{\pi(\mu')}{\pi(\mu_{t-1})}\times \dfrac{\Phi(\mu_{t-1}/\sigma)}{\Phi(\mu'/\sigma)}$$hence the truncation impacts the Metropolis-Hastings acceptance ratio.

Note that there are several X validated posts on the issue of simulating positive parameters using Metropolis-Hastings, like this one.

Here is an illustration for the target density $$\pi(\mu)\propto\exp\{-(\log \mu -1)^2\}\,\exp\{-(\log \mu -3)^4/4\}$$ when using $\sigma=.1$ as the scale in the truncated Normal:

for (t in 2:1e4){

enter image description hereenter image description here

  • 1
    $\begingroup$ I saw the cross-post but couldn't implement given that knowledge :-) Thanks for your detailed answer! $\endgroup$
    – user469216
    Commented May 11, 2018 at 10:39
  • $\begingroup$ By pi of u' I assume you mean the posterior and not the prior right? $\endgroup$
    – user469216
    Commented May 11, 2018 at 11:18
  • $\begingroup$ alright, thats what I thought :-) thanks again $\endgroup$
    – user469216
    Commented May 11, 2018 at 11:21
  • $\begingroup$ Technically, this MH algorithm would be not theoretical exact, right, due to the approximation in pnorm? $\endgroup$ Commented Apr 18 at 13:24
  • $\begingroup$ @Greenparker: the level of approximation in pnorm is so low that it does not matter for all practical purposes. $\endgroup$
    – Xi'an
    Commented Apr 18 at 13:47

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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