Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [mcmc]

Markov Chain Monte Carlo (MCMC) refers to a class of methods for generating samples from a target distribution by generating random numbers from a Markov Chain whose stationary distribution is the target distribution. MCMC methods are typically used when more direct methods for random number generation (e.g. inversion method) are infeasible. The first MCMC method was the Metropolis algorithm, later modified to the Metropolis-Hastings algorithm.

0
votes
1answer
21 views

sampling from normal distribution using MCMC doesn't seem correct [on hold]

I'm trying to sample from the normal distribution with a mean of .5 (like flipping a coin) and an arbitrary standard deviation using a markov chain (sequence of numbers where each number is dependent ...
0
votes
1answer
17 views

Setting an upper limit on an estimate

I have used MCMC to estimate the value of a parameter $\theta$ from some data. I have thousands of samples from the (marginal) posterior distribution. The distribution of $\theta$ is roughly Normally ...
1
vote
1answer
26 views

MCMC sampling with a probability density function that have potential negative values

My question might be quite strange, but I will expose you the complete issue in order for you to help me. I am in the context of a parallel randomized clinical trial which aim is to compare two ...
0
votes
0answers
20 views

Is it right to vary $ \sigma $ in a single MCMC chain at different times?

I am doing an MCMC analysis of Planck CMB data (https://en.wikipedia.org/wiki/Cosmic_microwave_background) for a particular Physical model of the universe. In the analysis I am trying to estimate a ...
1
vote
0answers
21 views

Does specifying normalizing constant significantly improves Hamiltonian Monte Carlo?

From my understanding the energy function needs only be specified such that it is proportional to the log density, and not specifying the normalizing constant should not greatly impact the sampling ...
0
votes
0answers
18 views

MCMC chains and Convergence

This may be a dumb question to ask, but I was doing MCMC sampling of my parameters $\alpha_1, \ \alpha_2 .... \alpha_{50}$, where $\alpha_i$ denotes for the same parameter $\alpha$ at the time i. I ...
1
vote
0answers
34 views

Convergence check in MCMC chains in R

I use Gelman-Rubin statistics, trace plots, autocorrelation plots and effective sample size to check the convergence. However, I got very different results from the above tests. The Gelman-Rubin ...
-1
votes
0answers
16 views

In RJags and MCMC in general, if I do not care about convergence, can I always set `n.chains` to be 1?

My understanding of RJags and implementing an MCMC model there is that the parameter n.chains will run however many chains you specify, but these chains are ...
9
votes
2answers
549 views

Maximum likelihood parameters deviate from posterior distributions

I have a likelihood function $\mathcal{L}(d | \theta)$ for the probability of my data $d$ given some model parameters $\theta \in \mathbf{R}^N$, which I would like to estimate. Assuming flat priors on ...
0
votes
0answers
11 views

MCMC After collecting the accepted samples, what to do with them next?

I'm a bit confused with the MCMC sampling. It is used to approximate an unknown posterior distribution. Suppose 1000 proposed samples are accepted. How to use these samples next? How to approximate ...
2
votes
0answers
45 views

An efficient way to generate multivariate normal distribution by Gibbs sampler? [closed]

When learning Gibbs sampler, the most used example is bivariate normal. But what if we want to simulate multivariate normal distribution? The computation (mean and variance) of conditional ...
1
vote
1answer
29 views

Ignoring the normalising constant in Bayesian MCMC

This post relates to my original question here, but this time focusing on a more fundamental misunderstanding of how MCMC actually works. When using Bayesian MCMC for parameter inference with a ...
0
votes
0answers
19 views

How to compute a combined likelihood involving multiple datasets?

I have a parametric model that generates $N$ time series, and my goal is to try to find a model where the $N$ predicted time series match $N$ observed time series relatively well. My physics-based ...
2
votes
0answers
30 views

Question about validity of an MCMC algorithm

Let suppose I want to sample from the posterior distribution of $X_1,X_2|y$ using an MCMC algorithm and let indicate with $X_i^t$ the value of $X_j$ at the $t-$th iterations. I want to know if the ...
2
votes
0answers
31 views

Combining “unbalanced” likelihoods in a “process-based” model

I have a "process-based" water quality model, which is essentially a black-box full of differential equations describing various chemical and hydrological processes. The model is deterministic and ...
3
votes
0answers
27 views

Is there an HMC algorithm that estimates a model with noncontinuous parameters?

Is there an HMC algorithm that estimates a model with noncontinuous parameters? All of the intuition I have for how HMC surfs around in the phase space is based on examples for posterior distributions ...
0
votes
0answers
15 views

Which gradient to compute in a hierarchical model for M-H MCMC?

We have the following model: $$y_t=Mx_t+\epsilon_t$$ with $M$ being a matrix such that $M\sim F_{\lambda}$(assume it's a conjugate prior). The $\lambda$ does not appear in $M$, only in its ...
1
vote
1answer
164 views

Naive Monte Carlo, MCMC and their use in Bayesian Theory

So let's suppose I have a random variable X which follows a PDF fX(x) which is known. I can use the Naive Monte Carlo method (...
5
votes
1answer
43 views

What does the distribution of samples from an MCMC method converge to without repeated samples?

Suppose I have an absolutely continuous distribution with density $f(x)$ and I use an mcmc sampler which has accept/reject step to sample from this distribution. In the final samples, there are some ...
1
vote
0answers
43 views

Why volume preservation is important for Metropolis update? [duplicate]

I think my question is naive but I would like to ask why why volume preservation is important for MCMC and specifically Metropolis update.I'm reading the following paper https://arxiv.org/pdf/1206....
3
votes
1answer
48 views

Estimate the asymptotic efficiency of a Markov chain sampling by the method of batching

In the paper Efficient Metropolis Jumping Rules, the author is writing that he used "the method of batching" for the estimation of $\operatorname{eff}_{\overline\theta_i}$ in Table 1 (on page 605). ...
3
votes
1answer
192 views

How does the Metropolis Algorithm “get off the ground”?

I'm thoroughly confused by the Metropolis Algorithm as defined in Casella and Berger's Statistical Inference. Namely, here's the definition (p.254): Let $Y \sim f_Y(y)$ and $V \sim f_V(v)$, where $...
6
votes
1answer
81 views

How can we verify the intuition that in the RW-Metropolis-Hastings algorithm with Gaussian proposal too small and too large variances are bad choices

Let $d\in\mathbb N$ and consider the Random Walk Metropolis-Hastings algorithm with a Gaussian proposal kernel $Q$ such that $Q(x,\;\cdot\;)=\mathcal N_d(x,\sigma^2_dI_d)$ for all $x\in\mathbb R^d$. ...
1
vote
1answer
72 views

Bayes factors from MCMC samples

I'm working to implement Bayesian model selection among models whose posteriors have already been sampled via MCMC. After reviewing some discussions of Bayes factors, I understand that they are ...
3
votes
2answers
62 views

Why is the proposal in the MALA algorithm always normally distributed?

Notation: $\pi(x)$ is the target density. $(x_n)_{n=1}^{N}$ is the chain generated by the MCMC method. At the moment, I am doing some research in MCMC methods. Before, I was planning to dive into the ...
3
votes
1answer
89 views

How can we numerically compute the autocorrelation of a sample from a Markov chain generated by the Metropolis-Hastings algorithm?

Let $(X_n)_{n\in\mathbb N_0}$ denote a $\mathbb R^d$-valued Markov chain generated by the Metropolis-Hastings algorithm. Suppose I've run the algorithm on a computer and obtained a sample $x_0,\ldots,...
2
votes
0answers
60 views

Numerical examples proving and disproving the optimal scaling heuristic by Roberts et al

Let $d\in\mathbb N$ with $d>1$ $\ell>0$ $\sigma_d^2:=\frac{\ell^2}{d-1}$ $f\in C^2(\mathbb R)$ be positive with $$\int f(x)\:{\rm d}x=1$$ and $g:=\ln f$ $Q_d$ be a Markov kernel on $(\mathbb R^...
0
votes
0answers
25 views

In an MCMC model, what happens if the observed data contains negative and positive observations, but a strictly positive model (Gamma) is used?

Suppose that we observe data that range from negative to positive support. Now, suppose we use a likelihood specification that is a Gamma, or some other distribution with strict positive support. I ...
0
votes
0answers
19 views

If we fit two Bayesian models to the same data with the same parameter, if there a way to compare model fit based on posterior interval widths?

Suppose that we have a dataset with a parameter of interest. If I were to fit two Bayesian models on the same data, and then generate the MCMC draws, I can come up with the posterior interval on the ...
3
votes
2answers
46 views

In a Bayesian MCMC model, if we plug the average of posterior draws back into the Likelihood, would it be estimating the Posterior Predictive?

Suppose we have a Bayesian model with data $y$ and a parameter to be estimated, $\theta$. Then the posterior is written as: $$ p(\theta | y) \propto p(y|\theta)p(\theta) $$ Suppose that we used an ...
5
votes
0answers
85 views

How does the celebrated result about the diffusion limit of the Random Walk Metroplis-Hastings algorithm help us to find the optimal scaling

Let $d\in\mathbb N$ with $d>1$ $\ell>0$ $\sigma_d^2:=\frac{\ell^2}{d-1}$ $f\in C^2(\mathbb R)$ be positive with $$\int f(x)\:{\rm d}x=1$$ and $g:=\ln f$ $Q_d$ be a Markov kernel on $(\mathbb R^...
1
vote
0answers
36 views

How to perform MCMC integration when no prior over the integrated function is available? [closed]

As far as I can tell, MCMC integration (e.g. VEGAS) is performed by sampling from a distribution proportional to $f(x)$ using MCMC, then building a density estimator $g(x)$ using these samples (for ...
0
votes
0answers
21 views

Metropolis-Hastings Algorithm for Bayesian Hierarchical model

I have developed a Metropolis-Hastings Algorithm for a double sigmoidal model, but now the aim is to create a Bayesian Hierarchical model that depends on incoming temperature data. For example, the ...
2
votes
1answer
58 views

Gibbs sampler for a multilevel model with no predictors in R

I'm working on multilevel models and want to know how they are estimated in R. For that purpose I'm reading amongst other things "Data Analysis Using Regression and Multilevel/Hierarchical Models" by ...
2
votes
0answers
15 views

Using some objective priors (for unbounded space) in a Metropolis-Hastings MCMC

I'm doing some simulations using a M-H MCMC, and I was thinking of using some objective priors for some parameters. These parameters must be in $\mathbb{R}^+$. I was thinking of using $\pi(\theta)\...
0
votes
0answers
22 views

Gibbs sampling where I can only find the mode of conditionals?

I'm trying to solve a problem with Gibbs Sampling, so I'm trying to do: $$ x_1^1 \sim p(x_1 | x_2^0, x_3^0)\\ x_2^1 \sim p(x_2 | x_1^1, x_3^0)\\ x_3^1 \sim p(x_3 | x_1^1, x_2^1)\\ x_1^2 \sim p(x_1 | ...
0
votes
0answers
58 views

A hierarchical Bayesian model in pymc3

Suppose we have the following model: $X$ unobserved $Y$ such that $Y|X \sim \mathcal{N}(X,\sigma^2)$, observed $Z$ such that $Z|X \sim \mathcal{B}(1,X)$, observed and suppose, given observed data $...
5
votes
1answer
170 views

Likelihood modification in Metropolis Hastings ratio for transformed parameter

I want to use MH to get samples from $p(\theta \mid y) \approx p(y \mid \theta) p(\theta)$. Let's assume $\theta$ is heavily constrained and I transform $\theta$ to $f(\theta)$ so I can sample from ...
8
votes
1answer
141 views

Would an “importance Gibbs” sampling method work?

I suspect this is a fairly unusual and exploratory question, so please bear with me. I am wondering if one could apply the idea of importance sampling to Gibbs sampling. Here's what I mean: in Gibbs ...
0
votes
0answers
13 views

Spatio-tempral Bayesian Poisson model convergence investigation

I am fitting a spatio-temporal Bayesian Poisson model with 22 explanatory variables, an offset variable, 2200 observations and non-informative priors. I am using the package ...
0
votes
0answers
34 views

Effective Sample Size for Weighted Samples

I have an MCMC sampler with weighted samples and I want to compute effective sample size at every step to determine sample degeneracy. I am using the following formula: $ESS = \frac{(\sum_{i=1}^N{w_i}...
0
votes
0answers
21 views

forward sampling for Bayesian network with continuous variables and equation-based causal relationships

I have a physical system which can be represented by the following Bayesian network. It has the following characteristics 1) The encoded variables are continuous variables 2) The causal ...
4
votes
0answers
95 views

Logistic Regression and Omitted Variable Bias

I just want to confirm that I am understanding this correctly. So if logistic regression models have omitted variable bias, does that mean that I should discard any logistic regression models that ...
6
votes
1answer
87 views

Can double dipping be reasonable?

I found a paper where the authors used bayesian methods to estimate asymmetric effects in impulse response functions. In short the estimation procedure is: Calculate a VAR and Impulse responses (no ...
5
votes
1answer
57 views

Can MCMC algorithm estimate partition function (normalizing constant)?

Importance Sampling can estimated the normalizing constant by averaging the weights (the ratio of unnoramlized distribution and importance distribution). Is there anyway that MCMC algorithm can ...
0
votes
0answers
77 views

Gibbs sampler for ARIMA AR(1) parameters: division by zero

Suppose the following AR(1) model: $$ y_t = \mu + \phi (y_{t-1} - \mu) + \epsilon_t $$ with $\epsilon_t \sim \mathcal{N}(0,\sigma^2)$. Following issue arises when sampling from $P(\mu_i \;|\; \phi_{...
17
votes
3answers
2k views

Are MCMC without memory?

I'm trying to understand what Markov chain Monte Carlo (MCMC) are from the French Wikipedia page. They say "that the Markov chain Monte Carlo methods consist of generating a vector $x_ {i}$ only from ...
2
votes
0answers
48 views

Bayesian estimation of traffic flow - Help with methodology

I need help setting up a model for estimation of traffic flow. I shall do the analysis with a Bayesian approach. Data: I have sensor data from ten sensors. The sensors are installed at three main ...
2
votes
1answer
36 views

Gibbs sampling allocations for time dependent observations from this model

I observe $N$ observations $\{x_{1,t_1}, \dots, x_{N,t_N}\}$ from a $k$ component Gaussian Mixture model. The $i$th observation is seen at time stamp $t_i$ and is distributed such that each $x_{i,t_i}|...
1
vote
0answers
25 views

sampling mechanism for correlated variables [closed]

Assuming Y=f(x1,..,Xn), while doing Monte Carlo simulation, I need to sample x1, ..xn based ...