Questions tagged [metropolis-hastings]

A special type of Markov Chain Monte Carlo (MCMC) algorithm used to simulate from complex probability distributions. It is validated by Markov chain theory and offers a wide range of possible implementations.

Filter by
Sorted by
Tagged with
0
votes
0answers
20 views

Metropolis Hastings Stuck in Local maxima

I've been running the metropolis hastings algorithm to infer some parameters. After running multiple chains, there are typically two places the chains get stuck in, one of which has a higher ...
0
votes
1answer
50 views

Metropolis Hastings algorithm for joint posterior of probability of heads for 2 coins

I am trying to implement a simple metropolis hastings algorithm to simulate the joint posterior of the probability of flipping heads for 2 coins, $\theta_1,\theta_2$. I am following the problem ...
-1
votes
1answer
24 views

Discrete Proposal distribution MCMC

If you want to perform MCMC (Metropolis-Hastings) to infer discrete values, what are some proposal distributions you can use for this. I can't think of a way to extend the notion of a gaussian ...
0
votes
0answers
47 views

Metropolis-Hastings Discrete Proposal Distribution

I have a Metropolis-Hastings scheme implemented, where I am currently inferring a number of parameters using Gaussian proposal distributions. However, I would now like to assume I don't know the ...
1
vote
1answer
26 views

Computing the hastings ratio, g(x|x')/g(x'|x) for asymmetric proposal distributions in MH algorithm?

I understand the Metropolis algorithm. Where I get confused is the MH algorithm where asymmetric proposal distributions may be used. I understand that P(x) and P(x') represent the likelihood/...
0
votes
0answers
11 views

Uncorrelated Samples from a non-conjugate (but well behaved) posterior

I'm trying to create a Dirichlet process mixture model with a kernel distribution similar to a product of gammas. (in fact, if I generate a latent random variable, it IS a product of (independent) ...
2
votes
1answer
70 views

Metropolis -> Metropolis-Hastings for asymmetric proposal distributions?

The below python code implements the Metropolis algorithm and samples from a single variable gaussian distribution. The initial value is sampled uniformly within 5 standard deviations of the mean. ...
0
votes
0answers
35 views

Jacobian term for Metropolis Hastings algorithm?

Suppose an acceptance ratio of the MH sampler without parameter transformation is like this: \begin{gather} r=\frac{f( \theta ',\gamma '|y,m) q( \theta ',\gamma '|\theta ,\gamma )}{f( \theta ,\gamma |...
2
votes
1answer
39 views

Approximation in hierarchical model

Consider a simple Bayesian hierarchical model: $y | \theta \sim P(y | \theta)$ $\theta | \phi \sim P(\theta | \phi)$ $\phi \sim P(\phi)$ I'm interested in drawing from the posterior distribution of $\...
1
vote
0answers
46 views

How should I implement an adaptive Metropolis algorithm for a Gibbs sampler with two Metropolis steps?

Consider the Gibbs sampler Sample $\theta' \sim p(\theta|\tau, D)$ Sample $\tau' \sim p(\tau|\theta', D)$ Both conditional distributions are sampled with a Metropolis step. The joint distribution is ...
1
vote
1answer
79 views

Metropolis-Hastings exercise with Cauchy and normal distributions [self-study]

I have the following exercise to solve and would appreciate some help. Consider a linear regression model $y = X\beta + \varepsilon$, where $y = (y_1,...,y_T)'$, $X = (x_1,...,x_T)$, $x_t$ is a single ...
3
votes
0answers
35 views

Escape unsuccessful accept-reject step in MCMC

I have an MCMC procedure that samples latent variables $h_1, \dots, h_T$. It is based on Shephard and Pitt (1997), https://doi.org/10.1093/biomet/84.3.653. Let $f$ be the true conditional posterior ...
3
votes
1answer
149 views

Metropolis-Hastings: target distribution with two modes; deterministic transformation

I'm trying to construct a Metropolis-Hastings algorithm to sample a target distribution $p(x)$ with two different and isolated modes. The example I'm working with is \begin{equation} p(x) = \frac{\...
5
votes
2answers
127 views

Optimization as sampling for stochastic functions

Given an input space $X$ and a function $f: X\rightarrow \mathbb R$, we want to find $x^*=argmin_{x\in X} f(x)$. One way is to cast this problem as a sampling, where we define a distribution $p(x)\...
2
votes
1answer
54 views

Quickest Way For Me To Learn About Metropolis Hastings

First of all, thanks for reading. I have a month to learn about Metropolis-Hastings with mathematical rigour, and i don't have other responsibilities. I am using second edition of "Monte Carlo ...
0
votes
1answer
35 views

Metropolis-Hastings undersampling near kink in distribution function

I'm trying to use Metropolis-Hastings to sample from a distribution that's very close to $$\exp(-|x|/\ell)$$ and I'm finding that the method is undersampling near the origin, where there's a kink in ...
3
votes
1answer
106 views

Finding the target distribution for the Metropolis algorithm

Let's consider the Markov chain $X_n$ defined on $\mathbf{X} = \{0,1,2...,n \}$, generated according to Metropolis algorithm. Let $X_0 := 0$ be a starting state. The accepting rule is as follows: if $...
3
votes
2answers
625 views

What is the intuition behind the Metropolis-Hastings Algorithm? [duplicate]

I've been studying Bayesian Statistics lately, and just came across the Metropolis-Hastings Algorithm. I understand that the goal is to sample from an intractable posterior - but I'm not really able ...
-1
votes
1answer
54 views

What do we commonly call a Sampler ? and the link between MonteCarlo, Metropolis-Hasting method, MCMC method and Fisher formalism

Sorry to ask multiples questions but they are all related to the same problematic. I would like to get explanations/clarifications as much as possible since I am going to use all these methods in the ...
3
votes
1answer
56 views

Metropolis Hastings for Posterior of Bivariate Normal

As an exercise, I am trying to implement metropolis hastings to draw samples from the posterior distribution of a bivariate normal: $$ (X,Y) \sim N \left( (0,0)\begin{bmatrix}1 & \rho \\ \rho &...
0
votes
0answers
11 views

What is the differnce between simulation and estimation in bayesian statistics? [duplicate]

Can someone help me understand the difference between simulation and estimation of different Bayesian statistical methods like MCMC or metropolis-hasting etc.
3
votes
1answer
56 views

MCMC - one chain behaving differently

I'm using an adaptive MCMC (metropolis-hastings) scheme to infer some parameters. I've run 7 chains, each starting from a random point. 6 of the chains vaguely converge to the same area, but one of ...
0
votes
1answer
33 views

Can I do HMC with the wrong Hamiltonian?

I am a novice HMC user. I am reading Neal's chapter in the Handbook of MCMC. I think I can present the HMC algorithm as : Sample a new momentum Propose a new momentum and a new position using a ...
1
vote
0answers
27 views

Why does Metropolis-Hastings build a simulated density function from the visit counts and not the target values?

From Kruschke's Doing Bayesian Data Analysis, he states that with Metropolis-Hastings, "each position will be visited proportionally to its target value". By 'target value' he means the calculation of ...
2
votes
0answers
17 views

How the Markov Chain Monte Carlo chains can be trusted through diagnostic plots

I am given several diagnostic plots of parameter values from a generated MCMC chains. . It is asking me that Do the diagnostic plots suggest that the MCMC chains can be trusted? My attempt: I tried ...
2
votes
1answer
32 views

How to generalize shrinkage to fully-bayesian models?

I've got a time series that I'm modelling as an exponential; growth rate, with the rate following a logistic distribution: $$ y_t = e^{x_t r_t} $$ where $$ r_t = \frac{L}{1-e^{-k(x_t-x_0)}} $$ I've ...
2
votes
0answers
78 views

Asymptotic variance of Metropolis-Hastings estimates on a disjoint subdivision of the state space

I'm running the Metropolis-Hastings algorithm on a state space $(E,\mathcal E)$ which can be disjointly subdivided into regions $E_1,\ldots,E_k$, $k\in\mathbb N$ ($k\approx1e5$). On $E$, I have a ...
2
votes
1answer
89 views

What should be the burn in period for Metropolis-within-Gibbs?

I need to get samples from an unnormalized distribution $p(\theta, \tau | D)$. However, sampling directly from the joint distribution with Metropolis-Hastings is hard, as the sampler rarely finds ...
0
votes
0answers
45 views

Variance estimates for a huge number of estimates

I'm estimating a finite number ($\approx1e5$) of integrals $\lambda g$ using the Metropolis-Hastings algorithm with target distribution $\mu=\frac{p\lambda}c$ (where $c:=\lambda p\in(0,\infty)$) and ...
1
vote
2answers
45 views

Simulated annealing acceptance probability puzzle

My understanding of simulated annealing (SA) is that at any iteration $t$, a new sample $Y_t$ is generated, which, if the objective function $E$ is improved, i.e., $E(Y_t)<E(X_{t-1})$, then $Y_t$ ...
1
vote
0answers
14 views

Are there methods or considerations for real-time Gelman-Rubin diagnosis while running multiple mcmc chains in parallel?

I have a Metropolis-Hastings algorithm in Python and I parallelized it with the multiprocessing library. However, at this moment I can only do Gelman-Rubin diagnosis when all generated parallel chains ...
0
votes
0answers
70 views

I'm searching for a sampling kernel capturing the idea of a small local perturbation (like the normal distribution does)

Let $d\in\mathbb N$. I'm searching for a Markov kernel $\kappa$ on $\left([0,1)^d,{\mathcal B([0,1))}^{\otimes d}\right)$ suitable for the following application: Given $x\in[0,1)^d$, I want to sample ...
0
votes
1answer
49 views

How do we need to define the acceptance ratio of the Metropolis-Hastings algorithm for a vanishing proposal density?

I've seen that different authors define the acceptance probability $\alpha$ of the Metropolis-Hastings algorithm with target distribution density $p$ and proposal kernel density $q$ differently; some ...
0
votes
0answers
49 views

How should I compute this proposal kernel density?

Let $d\in\mathbb N$ and $$u(x,y):=\beta+(1-\beta)\prod_{i=1}^d\psi(y_i-x_i)\;\;\;\text{for }x,y\in[0,1)^d,$$ where $\beta\in[0,1]$, $$\psi(x):=\sum_{k\in\mathbb Z}\varphi(k+x)\;\;\;\text{for }x\in(-1,...
1
vote
0answers
57 views

Insufficient floating point precision for the correct computation of a density

I'm using the Metorpolis-Hastings algorithm in a setting where the acceptance function is essentially of the form $$\alpha(x,y)=1\wedge\frac{u(x,y)}{v(x,y)},$$ where $$u(x,y)=p+(1-p)\prod_{i=1}^mu_i(x,...
1
vote
0answers
21 views

Metropolis Hastings algorithm and Markov chains [duplicate]

Why does Metropolis Hastings algorithm need/make a sequence of interdependent samples, i.e., a Markov chain in order to generate a posterior distribution?
3
votes
1answer
119 views

What is the relationship between Metropolis Hastings and Simulated Annealing?

Context and Problem In the Wikipedia page for Simulated Annealing they state The simulation can be performed either by a solution of kinetic equations for density functions[2][3] or by using the ...
0
votes
1answer
77 views

How do I account for numerical overflow with Adaptive MCMC?

EDIT: I tested Forgottenscience's solution below and it works; however, note that I found the working acceptance criterion to be that if $\log\alpha \geq \log u$, the point is accepted, where $u\sim\...
2
votes
0answers
29 views

MCMC converges to MAP and stays at same value - what may go wrong?

I am working on a Gibbs sampler which is complex and I would like to avoid giving all the details here. I will focus on the most necessary details. The Gibbs sampler involves parameters and latent ...
0
votes
0answers
17 views

Control the asymptotic variance of a finite number of integrals whose integrands supports build a disjoint cover of the entire space

I'm estimating a finite number $k\in\mathbb N$ of integrals $$\int h_jf\:{\rm d}\mu,\tag1$$ $j=1,\ldots,k$, where $f$ is a square-integrable nonnegative function on a measure space $(E,\mathcal E,\...
1
vote
0answers
46 views

Metropolis-Hastings with a “Dirac transition”

I'm running the Metropolis-Hastings algorithm on a product space $\tilde E:=I\times E'$, where $I$ is a finite nonempty set and $E'=\bigcup_{i\in I}E'_i$ with $E'_i:=[0,1)^{d_i}$ for $i\in I$. Given ...
0
votes
0answers
19 views

What is the difference between the transition kernel and the proposal density?

When considering MCMC, could someone explain the difference between the transition kernel and the porposal density for me please? Proposal density is the function we use to sample from the proposal ...
1
vote
0answers
59 views

Proposal Function For Variables That Sum To 1 (Dirichlet Prior)

Recently I've been trying to use MCMC to infer a set of 50 random variables (species frequencies) that sum to 1 with the Metropolis-Hastings algorithm. However, the algorithm is not working well ...
2
votes
2answers
91 views

How to use the MCMC method for multivariate distributions?

I wish to find the posterior of a joint distribution of 4 parameters whose prior and likelihoods are known, but I do not understand how to accept and reject samples, in any other case other than ...
1
vote
0answers
14 views

proposal value between the generated data and the accepted previous proposal

I have a question here that has been confusing me these two days. So in mcmc hasting metropolis if a proposal value was accepted which means tha it's going to be the current value after that ...
2
votes
0answers
63 views

Estimating the asymptotic variance of a specific Metropolis-Hastings estimator

Remark: I've added a detailed description of the actual setting of the application to the end of the question. I'm running the Metropolis-Hastings algorithm with target distribution $\hat\mu$ (see ...
3
votes
1answer
115 views

Do I need to evaluate acceptance rates in Metropolis within Gibbs algorithm?

Consider the Gibbs sampler Sample $\theta' \sim p(\theta|\tau, D)$ Sample $\tau' \sim p(\tau|\theta', D)$ where $\theta,\tau$ parameters of the data $D$. Now assume that we can only sample from $p(\...
0
votes
1answer
48 views

Can a Metropolis-Hastings estimator converge if the proposal density vanishes whenver the target density vanishes?

I'm running the Metropolis-Hastings algorithm for a target and proposal density $p$ and $q$, respectively, for which it holds $$p(y)=0\Rightarrow q(x,y)=0\;\;\;\text{for all }y.\tag1$$ By definition ...
0
votes
1answer
39 views

Proof of convergence in original Metropolis algorithm paper

I've been trying to understand the original paper in which the Metropolis algorithm was proposed, specifically the proof of convergence given in section II. The final step in the proof gives the ...
1
vote
0answers
45 views

Can we find an asymptotically consistent Metropolis-Hastings estimator based on this proposal scheme?

I'm running the Metropolis-Hastings algorithm for a target distribution $\hat\mu$ (see below for the formal setup including the definition of $\hat\mu$) on a product space $I\times E'$. I'm using the ...

1
2 3 4 5
8