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
1answer
45 views

Metropolis-Hastings with non-centered Proposal

I am trying to draw samples from the Laplace distribution $\pi^* = \text{exp}(-|\theta|)$, using Metropolis Hastings algorithm with a noncentered proposal, meaning that regular Metropolis wont work.. ...
1
vote
0answers
28 views

what is the optimal step size for metropolis-hastings algorithm to have independent state

In the PRML chapter 11, The Metropolis-Hasting algorithm, For a sampler with Gaussian distribution as proposal distribution. The original distribution is correlated multivariate Gaussian distribution, ...
0
votes
0answers
5 views

How to sample posterior distribution for models with random effects?

I have a time series model contains some fixed parameters ($\beta_{1}$, k, m, etc. ) and also a random effect (i.e. $\beta_{t}$ follows a random walk, with starting value $\beta_{1}$ and variance ...
1
vote
0answers
25 views

Metropolis-Hastings algorithm for a completely specified distribution

Consider a random variable $X\sim f(x)$, such that $$ f(x)=\frac{1}{c}\times K(x)\propto K(x), $$ where c: normalizing constant, K(x): the kernel of the distribution (ie the part which involves $x$). $...
0
votes
0answers
36 views

Application of Metropolis Hastings

I am trying to implement the Metropolis Hastings algorithm for Bayesian analysis. In this case, the parameter of interest is the scale parameter for a Weibull distribution. The context is for ...
0
votes
3answers
44 views

Real-life example in which Markov chain Monte Carlo is desirable? [duplicate]

A typical introduction to the Metropolis--Hastings algorithm, and hence to Markov chain Monte Carlo techniques in general, starts with the following assumptions on some probability distribution $P(x)$ ...
0
votes
0answers
12 views

Metropolis Hastings for BART: Calculation of Tree Prior and Transition Kernel

I am trying to understand the details of BART (Bayesian Additive Regression Trees). In particular, I would like to know how the Metropolis Hastings acceptance probability is calculated for BART. My ...
2
votes
0answers
19 views

Gibbs updating algorithm (Gibbs steps) for computationally expensive likelihood

I am looking for a good way to update steps in a Gibbs sampler where the likelihood function is computationally expensive. Here is what I tried so far: By default JAGS uses a slice sampler. However, ...
0
votes
0answers
11 views

Bias in unbiased pseudo-marginal estimation

In the Pseudo-marginal Metropolis-Hastings algorithm exact sampling of a posterior distribution is performed when using an unbiased estimate of the marginal likelihood. However, I am having problems ...
0
votes
0answers
9 views

Updating only a subset during Metropolis updates: Is this method ergodic

I am currently implementing a multivariate random walk Metropolis sampler (Metropolis within Gibbs). One problem I have is that computing the likelihood is computationally expensive. Thus, I am ...
0
votes
0answers
27 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
77 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
30 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
55 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
33 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
12 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
120 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
46 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
41 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
51 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
105 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
36 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
168 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
147 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
57 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 ...
4
votes
1answer
110 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 $...
4
votes
2answers
721 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
55 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
108 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
60 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
35 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
19 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
129 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
54 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
53 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
50 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
58 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
260 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
93 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
38 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
2 3 4 5
8