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
40 views

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

I have the following exercise to solve and would appreciate some help. Consider 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
31 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 ...
2
votes
1answer
62 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
66 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
52 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
32 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
99 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 $...
2
votes
2answers
549 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
42 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
48 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
10 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.
2
votes
1answer
47 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
28 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
14 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
31 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
77 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
70 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
44 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
41 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
13 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
68 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
45 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
19 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?
2
votes
1answer
61 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
62 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
25 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
45 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
14 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
43 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
86 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
13 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
62 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
94 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
46 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
35 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
43 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 ...
2
votes
0answers
94 views

Can we use of the Metropolis-Hastings importance sampling estimator here?

EDIT: Note that proposing according to $\hat Q$ is equivalent to the following scheme: Given the current state $\tilde x=(i,x')\in\tilde E:=I\times E'$ and $x:=\varphi_i(x')$, sample $j\sim\tilde T(\...
2
votes
2answers
91 views

Uniform random vector with zero sum restriction?

I'm building a Metropolis transition kernel and figured out I would need a very specific distribution for optimal results. How can I construct a random vector $(U_1, U_2, \dots, U_n)$ such that $\...
2
votes
1answer
83 views

Erroneous expression for Metropolis-Hastings acceptance ratio in a paper

Let $(E,\mathcal E)$ be a measure space; $\rho:E\to[0,\infty)$ be $\mathcal E$-measurable, $p:E^2\to[0,\infty)$ be $\mathcal E^{\otimes2}$-measurable, $$r(x,y):=\left.\begin{cases}\displaystyle\frac{\...
0
votes
0answers
40 views

How do I use the MCMC method to find the joint posterior of 4 parameters ($\lambda$,$\lambda_s$,$\mu$,$\beta$) of exponential distributions

Essentially, the problem statement is as follows. I have 2 functions in reliability theory called MTTF(Mean time to failure) and Availablity, both with inputs as $\lambda$,$\lambda_s$,$\mu$ & $\...
0
votes
0answers
32 views

Is that possible that I use an arbitrary prior distribution that is not conjugate to the likelihood and do mcmc sampling?

In Bayesian Statistics, we can use conjugate priors to the likelihood functions, then we can get the posterior distributions which are the same distributions as the prior distributions. I wonder ...
4
votes
1answer
395 views

Random Walk Metropolis Hastings implementation in R using log scale

Context I looked literally everywhere but I couldn't find a complete implementation of the Random Walk Metropolis-Hastings algorithm using the log scale. By log scale I mean that we are working with ...
2
votes
0answers
47 views

Can we use Gelman-Rubin diagnostic to assess convergence of parallel tempered chains in MCMC?

I know that the principle behind the Gelman-Rubin diagnostic is comparing within-chain and between-chain variances and if the potential scale reduction factor is less than, say 1.1 or 1.05 then the ...
2
votes
0answers
26 views

Asymptotic convergence of the Metropolis-Hastings algorithm with a not necessarily positive target density

Consider the Metropolis-Hastings algorithm on a general state space. Let $p$ denote the density of the target distribution $\mu$, $(X_n)_{n\in\mathbb N_0}$ denote the generated Markov chain and $\...
2
votes
1answer
50 views

Proposal Metropolis distribution for complex Bayesian models

In the book Uncertainty Quantification: Theory, Implementation, and Applications, by R.C. Smith, there is a chapter about Bayesian inference. The likelihood is Gaussian, with error variance $\sigma^2$ ...
0
votes
1answer
107 views

What does MCMC do during burn-in period?

I am studying mcmc and I am wondering what mcmc does during burn-in period. And also what is the difference during burning period and after the burn-in period?

1
2 3 4 5
8