47 votes
Accepted

Variational inference versus MCMC: when to choose one over the other?

For a long answer, see Blei, Kucukelbir and McAuliffe here. This short answer draws heavily therefrom. MCMC is asymptotically exact; VI is not. In the limit, MCMC will exactly approximate the target ...
Sean Easter's user avatar
  • 8,734
39 votes
Accepted

When would one use Gibbs sampling instead of Metropolis-Hastings?

Firstly, let me note [somewhat pedantically] that There are several different kinds of MCMC algorithms: Metropolis-Hastings, Gibbs, importance/rejection sampling (related). importance and ...
Xi'an's user avatar
  • 104k
35 votes
Accepted

Hamiltonian Monte Carlo vs. Sequential Monte Carlo

Hamiltonian Monte Carlo performs well with continuous target distributions with "weird" shapes. It requires the target distribution to be differentiable as it basically uses the slope of the target ...
RemiDav's user avatar
  • 484
35 votes
Accepted

Posterior distribution and MCMC

If this was not a clear conflict of interest, I would suggest you invest more time on the topic of MCMC algorithm and read a whole book rather than a few (6?) articles that can only provide a partial ...
Xi'an's user avatar
  • 104k
32 votes
Accepted

Computation of the marginal likelihood from MCMC samples

The extension by Chib and Jeliazkov (2001) unfortunately gets quickly costly or highly variable, which is a reason why it is not much used outside Gibbs sampling cases. While there are many ways and ...
Xi'an's user avatar
  • 104k
31 votes
Accepted

Predictions from BSTS model (in R) are failing completely

Steve Scott here. I wrote the bsts package. I have a few suggestions for you. First, your seasonal components aren't doing what you think they are. I think you have daily data, because you're ...
Steve Scott's user avatar
31 votes

Gibbs sampler examples in R

Problem Suppose $Y \sim \text{N}(\text{mean} = \mu, \text{Var} = \frac{1}{\tau})$. Based on a sample, obtain the posterior distributions of $\mu$ and $\tau$ using the Gibbs sampler. Notation $ \...
ocram's user avatar
  • 21.7k
29 votes
Accepted

Can Machine Learning or Deep Learning algorithms be utilised to "improve" the sampling process of a MCMC technique?

Yes. Unlike what other answers state, 'typical' machine-learning methods such as nonparametrics and (deep) neural networks can help create better MCMC samplers. The goal of MCMC is to draw samples ...
lacerbi's user avatar
  • 5,186
29 votes
Accepted

Doing MCMC: use jags/stan or implement it myself

In general, I would strongly suggest not coding your own MCMC for a real applied Bayesian analysis. This is both a good deal of work and time and very likely to introduce bugs in the code. Blackbox ...
Cliff AB's user avatar
  • 20.7k
29 votes

Why is it necessary to sample from the posterior distribution if we already KNOW the posterior distribution?

This question has likely been considered already on this forum. When you state that you "have the posterior distribution", what exactly do you mean? "Having" an available$-$in the ...
Xi'an's user avatar
  • 104k
28 votes
Accepted

Are MCMC without memory?

The defining characteristic of a Markov chain is that the conditional distribution of its present value conditional on past values depends only on the previous value. So every Markov chain is "...
Ben's user avatar
  • 123k
27 votes

When did MCMC become commonplace?

This paper by Christian (Xi'an) Robert and George Casella provides a nice summary of the history of MCMC. From the paper (emphasis is mine). What can be reasonably seen as the first MCMC algorithm is ...
knrumsey's user avatar
  • 7,467
23 votes
Accepted

Is the mean of samples still a valid sample?

No, $\bar x$ has its own sampling distribution. Take, for example, the variances of $\bar x$ and $x_i$, in which the former is always lower ($\leq$) than the latter, which means $\bar x$ is not ...
gunes's user avatar
  • 57k
22 votes

Effective Sample Size for posterior inference from MCMC sampling

The question you are asking is different from "convergence diagnostics". Lets say you have run all convergence diagnostics(choose your favorite(s)), and now are ready to start sampling from the ...
Greenparker's user avatar
  • 15.5k
22 votes

Is the mean of samples still a valid sample?

Good examples so far but consider $$X_i \sim Bernoulli(.5)$$ In that case the distribution of the data will only have support on 0 and 1. But the sample mean will have an ever decreasing probability ...
Dason's user avatar
  • 2,163
20 votes
Accepted

Probabilistic programming vs "traditional" ML

It's generally true in my personal experience as a professional data scientist. It's true in my personal experience because it's what I observe most of the time. If you're asking why it happens this ...
shadowtalker's user avatar
  • 12.4k
20 votes

Why don't we see Copula Models as much as Regression Models?

The first and most important reason is that standard regression models had a one to two-hundred year headstart on copula models (depending on exactly where you count the genesis of regression models ...
Ben's user avatar
  • 123k
19 votes
Accepted

How do ABC and MCMC differ in their applications?

Some additional comments on top of Björn's answer: ABC was first introduced by Rubin (1984) as an explanation of the nature of Bayesian inference, rather than for computational purposes. In this ...
Xi'an's user avatar
  • 104k
18 votes
Accepted

Bayesian inverse modeling with non-identifiable parameters?

Adding priors does not solve the identifiability problem This is a case where the parameters are non-identifiable in your model. As you point out, contributions from the individual non-identifiable ...
Ben's user avatar
  • 123k
18 votes
Accepted

Divergent transitions in Stan

A divergent transition in Stan tells you that the region of the posterior distribution around that divergent transition is geometrically difficult to explore. For example here is a quote from the ...
Patrick's user avatar
  • 1,419
17 votes

How do ABC and MCMC differ in their applications?

The difference is that with ABC you do not need an analytic expression for $P(x|\theta)$ and instead approximate it by simulating data and seeing for which values of $\theta$ simulated data most often ...
Björn's user avatar
  • 31.5k
17 votes
Accepted

Understanding MCMC: what would the alternative be?

You are describing a grid approximation to the posterior, and that is a valid approach, allthough not the most popular. There are quite a few cases in which the posterior distribution can be computed ...
Gijs's user avatar
  • 3,644
16 votes
Accepted

Proposal distribution - Metropolis Hastings MCMC

A1: Indeed the Gaussian distribution is probably the most used proposal distribution primarily due to ease of use. However, one might want to use other proposal distributions for the following reason ...
Greenparker's user avatar
  • 15.5k
16 votes
Accepted

Why Hamiltonian dynamics is better than random walk proposal in MCMC in some cases?

First of all, let me state that I don't believe that the acceptance rate for HMC (Hamiltonian Monte Carlo) is always higher than for the Metropolis algorithm. As noted by @JuhoKokkala, the acceptance ...
DeltaIV's user avatar
  • 17.8k
16 votes

Are MCMC without memory?

While we have the correct answer, I would like to expand just a little bit on the intuitive semantics of the statement. Imagine that we redefine our indices such that you generate vector $x_{i+1}$ ...
rumtscho's user avatar
  • 1,809
16 votes
Accepted

Maximum likelihood parameters deviate from posterior distributions

With flat priors, the posterior is identical to the likelihood up to a constant. Thus MLE (estimated with an optimizer) should be identical to the MAP (maximum a posteriori value = multivariate mode ...
Florian Hartig's user avatar
16 votes

Maximum likelihood parameters deviate from posterior distributions

Some possible generic explanations for this perceived discrepancy, assuming of course there is no issue with code or likelihood definition or MCMC implementation or number of MCMC iterations or ...
Xi'an's user avatar
  • 104k
16 votes
Accepted

What is the correct effective sample size (ESS) calculation?

After further research, I've made some useful discoveries. The answer appears to be anything but straightforward. Let me start by answering my second question above: "What is the correct effective ...
Earlien's user avatar
  • 708
15 votes
Accepted

For Hamiltonian Monte Carlo, why does negating the momentum variables result in a symmetric proposal?

One of the reasons why the original construction of Hamiltonian Monte Carlo can be tricky to understand is that it is more restrictive than necessary, if only to simplify the theoretical proofs. In ...
Michael Betancourt's user avatar
15 votes
Accepted

Is Gibbs sampling an MCMC method?

The algorithm that is now called Gibbs sampling forms a Markov-chain and uses Monte-Carlo simulation for its inputs, so it does indeed fall within the proper scope of MCMC (Markov-Chain Monte-Carlo) ...
Ben's user avatar
  • 123k

Only top scored, non community-wiki answers of a minimum length are eligible