# \#mcmc

**URL:** https://discourse.mc-stan.org/tag/mcmc/19.md

[Latest](https://discourse.mc-stan.org/latest.md) · [Categories](https://discourse.mc-stan.org/categories.md) · [Tags](https://discourse.mc-stan.org/tags.md)

---

## [Creating empty stanfit object and adding mcmc.list from model of class "JagsUI"](https://discourse.mc-stan.org/t/creating-empty-stanfit-object-and-adding-mcmc-list-from-model-of-class-jagsui/39383)

<div class="topic-metadata">

**Author:** [@mpstanden](https://discourse.mc-stan.org/u/mpstanden)\
**Replies:** 6\
**Last updated:** [May 2, 2025, 9:06pm UTC](https://discourse.mc-stan.org/t/creating-empty-stanfit-object-and-adding-mcmc-list-from-model-of-class-jagsui/39383 "2025-05-02T21:06:54Z")

</div>

I am trying to get WAIC from models run in JagsUI. I understand that I can use the loo package to extract WAIC using the log likelihood (like the code chunk below), but this can only be done with a stan model object of c…

---

## [Developing a Deeper Intuition for HMC: Connecting the Underlying Concepts with the Hamiltonian Equations](https://discourse.mc-stan.org/t/developing-a-deeper-intuition-for-hmc-connecting-the-underlying-concepts-with-the-hamiltonian-equations/38450)

<div class="topic-metadata">

**Author:** [@karl](https://discourse.mc-stan.org/u/karl)\
**Replies:** 10\
**Last updated:** [January 17, 2025, 1:32pm UTC](https://discourse.mc-stan.org/t/developing-a-deeper-intuition-for-hmc-connecting-the-underlying-concepts-with-the-hamiltonian-equations/38450 "2025-01-17T13:32:50Z")

</div>

I’m trying to develop a deeper understanding of HMC and how the sampling in Stan works, but it has proven to be difficult given the two main sources (Neal, Betancourt) that are out there. Most other tutorials are just co…

---

## [Definition of Markov chain standard error (MCSE)](https://discourse.mc-stan.org/t/definition-of-markov-chain-standard-error-mcse/33471)

<div class="topic-metadata">

**Author:** [@PToTheK](https://discourse.mc-stan.org/u/PToTheK)\
**Replies:** 7\
**Last updated:** [May 28, 2024, 7:43pm UTC](https://discourse.mc-stan.org/t/definition-of-markov-chain-standard-error-mcse/33471 "2024-05-28T19:43:52Z")

</div>

Hi Stan community, I am curious about the estimation of the asymptotic variance \\sigma^2, appearing in the definition of the MCSE for the mean value of a parameter (see MCMC central limit theorem). My question is: Why…

---

## [Bad diagnostics with multilevel models](https://discourse.mc-stan.org/t/bad-diagnostics-with-multilevel-models/29091)

<div class="topic-metadata">

**Author:** [@LeonhardSchwager](https://discourse.mc-stan.org/u/LeonhardSchwager)\
**Replies:** 4\
**Last updated:** [January 13, 2024, 2:24pm UTC](https://discourse.mc-stan.org/t/bad-diagnostics-with-multilevel-models/29091 "2024-01-13T14:24:58Z")

</div>

Hi there, I’m new to Bayesian statistics and so I really appreciate the easy to use and very flexible brms package - thanks a lot! Right now I’m trying to fit general logistic growth curves (cell population ratio in pe…

---

## [Zero-one-inflated beta regression with brms not finishing the chains](https://discourse.mc-stan.org/t/zero-one-inflated-beta-regression-with-brms-not-finishing-the-chains/32991)

<div class="topic-metadata">

**Author:** [@lorenzo\_cappiello](https://discourse.mc-stan.org/u/lorenzo_cappiello)\
**Replies:** 5\
**Last updated:** [October 18, 2023, 3:49pm UTC](https://discourse.mc-stan.org/t/zero-one-inflated-beta-regression-with-brms-not-finishing-the-chains/32991 "2023-10-18T15:49:17Z")

</div>

Hi, I am trying to run a zero-one-inflated beta mixed model with my study. Rational for using this model: The DV is a bounded variable signifying the likelihood a person is going to look to location A (0) or location B …

---

## [Creating a MCMC sampler based on the emcee python import](https://discourse.mc-stan.org/t/creating-a-mcmc-sampler-based-on-the-emcee-python-import/32398)

<div class="topic-metadata">

**Author:** [@Daniel-Rogo](https://discourse.mc-stan.org/u/Daniel-Rogo)\
**Replies:** 3\
**Last updated:** [September 6, 2023, 12:34pm UTC](https://discourse.mc-stan.org/t/creating-a-mcmc-sampler-based-on-the-emcee-python-import/32398 "2023-09-06T12:34:25Z")

</div>

Hello everyone, I am currently working on pystan 3.7, and I am trying to create a Monte Carlo model function in Stan that imitates or does the same thing as the python import emcee function, EnsembleSampler ( and Sample…

---

## [NUTS tree build - Time reversibility](https://discourse.mc-stan.org/t/nuts-tree-build-time-reversibility/32038)

<div class="topic-metadata">

**Author:** [@cuentadesanti](https://discourse.mc-stan.org/u/cuentadesanti)\
**Replies:** 3\
**Last updated:** [July 13, 2023, 10:59pm UTC](https://discourse.mc-stan.org/t/nuts-tree-build-time-reversibility/32038 "2023-07-13T22:59:44Z")

</div>

Hi, I’ve been trying to dig in to HMC theory and its variations and had a hard time understanding how the forward/backwards 2^n leapfrog integration tie in to allowing the NUTS to be reversible. Specifically, I’ve unders…

---

## [MCMC approximation of posterior for a simple model of human attention (Divergent transitions)](https://discourse.mc-stan.org/t/mcmc-approximation-of-posterior-for-a-simple-model-of-human-attention-divergent-transitions/29544)

<div class="topic-metadata">

**Author:** [@mrnoodle](https://discourse.mc-stan.org/u/mrnoodle)\
**Replies:** 0\
**Last updated:** [November 19, 2022, 10:44pm UTC](https://discourse.mc-stan.org/t/mcmc-approximation-of-posterior-for-a-simple-model-of-human-attention-divergent-transitions/29544 "2022-11-19T22:44:21Z")

</div>

Hey friends! I’m working on a probabilistic model of human attention. The model is defined by the following problem: We want to learn the \\mu and \\sigma of Gaussian random variable y via Bayesian inference. We have some…

---

## [New algorithm: Gradient-based Adaptive Markov Chain Monte Carlo](https://discourse.mc-stan.org/t/new-algorithm-gradient-based-adaptive-markov-chain-monte-carlo/15714)

<div class="topic-metadata">

**Author:** [@Red-Portal](https://discourse.mc-stan.org/u/Red-Portal)\
**Replies:** 13\
**Last updated:** [February 16, 2022, 9:41pm UTC](https://discourse.mc-stan.org/t/new-algorithm-gradient-based-adaptive-markov-chain-monte-carlo/15714 "2022-02-16T21:41:56Z")

</div>

Hi everyone, I know that the Stan forum is spammed by every MCMC algorithms published ever. But I think this one, “Gradient-based Adaptive Markov Chain Monte Carlo” is quite interesting. It was published last year at …

---

## [Explore different typical sets in HMC](https://discourse.mc-stan.org/t/explore-different-typical-sets-in-hmc/25534)

<div class="topic-metadata">

**Author:** [@Huaiyang\_Gongzi](https://discourse.mc-stan.org/u/Huaiyang_Gongzi)\
**Replies:** 4\
**Last updated:** [December 6, 2021, 8:01pm UTC](https://discourse.mc-stan.org/t/explore-different-typical-sets-in-hmc/25534 "2021-12-06T20:01:29Z")

</div>

Hello everyone, I am reading the paper of A Conceptual Introduction to Hamiltonian Monte Carlo, and have questions on typical set. My understanding is that , the whole point of designing HMC is to efficiently explore t…

---

## [How to interpret MCMC model result](https://discourse.mc-stan.org/t/how-to-interpret-mcmc-model-result/23857)

<div class="topic-metadata">

**Author:** [@ichinano](https://discourse.mc-stan.org/u/ichinano)\
**Replies:** 4\
**Last updated:** [August 23, 2021, 8:21pm UTC](https://discourse.mc-stan.org/t/how-to-interpret-mcmc-model-result/23857 "2021-08-23T20:21:46Z")

</div>

Hi everyone, I’m new to bayesian inference, especially running MCMC for parameter inference. So, I have successfully run my model, but I do not think that I got the result as I expected (see the result below, I have 11 …

---

## [Animating MCMC with Python](https://discourse.mc-stan.org/t/animating-mcmc-with-python/23936)

<div class="topic-metadata">

**Author:** [@ichinano](https://discourse.mc-stan.org/u/ichinano)\
**Replies:** 4\
**Last updated:** [August 16, 2021, 2:35pm UTC](https://discourse.mc-stan.org/t/animating-mcmc-with-python/23936 "2021-08-16T14:35:48Z")

</div>

Hi everyone, I am currently running an MCMC model with non-linear ODEs with so many parameters and have been having some difficulties in getting results that I expected. I am thinking that it would be very helpful if th…

---

## [Cross-chain warmup adaptation using MPI](https://discourse.mc-stan.org/t/cross-chain-warmup-adaptation-using-mpi/12912)

<div class="topic-metadata">

**Author:** [@yizhang](https://discourse.mc-stan.org/u/yizhang)\
**Replies:** 91\
**Last updated:** [July 2, 2021, 7:23pm UTC](https://discourse.mc-stan.org/t/cross-chain-warmup-adaptation-using-mpi/12912 "2021-07-02T19:23:55Z")

</div>

I’ve been working with @bbbales2 and @avehtari to materialize the campfire algorithm using MPI. The implementation is experimental, and we’d like to hear from you how the algorithm perform for your models. Setup The imp…

---

## [Running time of NUTS using Big O notation?](https://discourse.mc-stan.org/t/running-time-of-nuts-using-big-o-notation/17325)

<div class="topic-metadata">

**Author:** [@rjc10](https://discourse.mc-stan.org/u/rjc10)\
**Replies:** 2\
**Last updated:** [August 12, 2020, 9:21pm UTC](https://discourse.mc-stan.org/t/running-time-of-nuts-using-big-o-notation/17325 "2020-08-12T21:21:07Z")

</div>

Hi, I am writing up an analysis involving MCMC estimation of a model using Hamiltonian Monte Carlo with the No U-Turn Sampler. I am wondering, is there a description of the theoretical running time of the algorithm using…

---

## [Metropolis–Hastings :"We assume that the posterior density is locally flat over the region we sample from"](https://discourse.mc-stan.org/t/metropolis-hastings-we-assume-that-the-posterior-density-is-locally-flat-over-the-region-we-sample-from/15221)

<div class="topic-metadata">

**Author:** [@aldc](https://discourse.mc-stan.org/u/aldc)\
**Replies:** 7\
**Last updated:** [June 10, 2020, 8:38am UTC](https://discourse.mc-stan.org/t/metropolis-hastings-we-assume-that-the-posterior-density-is-locally-flat-over-the-region-we-sample-from/15221 "2020-06-10T08:38:07Z")

</div>

I’m working through Ben Lambert’s Students-Guide. (Chapter 13: Random Walk) I understood why Metropolis hasting on the surface, but didn’t really get it. Here, “We assume that the posterior density is locally flat over…

---

## [I wish to include holidays/events(similar to FBprophet) to stan model](https://discourse.mc-stan.org/t/i-wish-to-include-holidays-events-similar-to-fbprophet-to-stan-model/15388)

<div class="topic-metadata">

**Author:** [@AnonymousStan](https://discourse.mc-stan.org/u/AnonymousStan)\
**Replies:** 3\
**Last updated:** [May 27, 2020, 3:06am UTC](https://discourse.mc-stan.org/t/i-wish-to-include-holidays-events-similar-to-fbprophet-to-stan-model/15388 "2020-05-27T03:06:22Z")

</div>

I wrote a code using MCMC algorithm where it could calculate the seasonality of a year(Please correct me if my logic and understanding about the algorithm is wrong since I am new to it.). I wish to add the same time e…

---

## [Experiences with the zig-zag process MCMC?](https://discourse.mc-stan.org/t/experiences-with-the-zig-zag-process-mcmc/13695)

<div class="topic-metadata">

**Author:** [@Red-Portal](https://discourse.mc-stan.org/u/Red-Portal)\
**Replies:** 5\
**Last updated:** [March 30, 2020, 8:16am UTC](https://discourse.mc-stan.org/t/experiences-with-the-zig-zag-process-mcmc/13695 "2020-03-30T08:16:41Z")

</div>

Hi everyone, I stubbled upon this new paper \[1\] published last year. Though the preprint was published 2 years ago. It talks about a new MCMC algorithm based on the zig-zag process. I wonder if anyone has tried to im…

---

## [Stan's ESS (and monotone autocorrelations)](https://discourse.mc-stan.org/t/stans-ess-and-monotone-autocorrelations/13666)

<div class="topic-metadata">

**Author:** [@Ben\_Lambert](https://discourse.mc-stan.org/u/Ben_Lambert)\
**Replies:** 5\
**Last updated:** [March 13, 2020, 6:48pm UTC](https://discourse.mc-stan.org/t/stans-ess-and-monotone-autocorrelations/13666 "2020-03-13T18:48:30Z")

</div>

I am trying to code up Stan’s effective sample size estimator as defined in Sections 16.4 of the reference manual here and basically wondered whether I’d understood the recipe correctly. Does the order of things go like: …

---

## [Why doesn't sampling fail when optimizing does?](https://discourse.mc-stan.org/t/why-doesnt-sampling-fail-when-optimizing-does/13094)

<div class="topic-metadata">

**Author:** [@jeffpollock9](https://discourse.mc-stan.org/u/jeffpollock9)\
**Replies:** 3\
**Last updated:** [February 13, 2020, 9:26pm UTC](https://discourse.mc-stan.org/t/why-doesnt-sampling-fail-when-optimizing-does/13094 "2020-02-13T21:26:29Z")

</div>

Hi, As far as I understand, finding the posterior mode via optimization usually doesn’t work for hierarchical models since the objective function is unbounded due to the contribution from the prior, e.g.: # parameters …

---

## [New Algorithm: Newtonian Monte Carlo paper](https://discourse.mc-stan.org/t/new-algorithm-newtonian-monte-carlo-paper/12352)

<div class="topic-metadata">

**Author:** [@stevebronder](https://discourse.mc-stan.org/u/stevebronder)\
**Replies:** 7\
**Last updated:** [February 7, 2020, 11:56pm UTC](https://discourse.mc-stan.org/t/new-algorithm-newtonian-monte-carlo-paper/12352 "2020-02-07T23:56:12Z")

</div>

Facebook just put out a paper on “Newtonian Monte Carlo” posting it here if anyone has an opinion on it. From the abstract: We present Newtonian Monte Carlo (NMC), a method to improve Markov Chain Monte Carlo (MCMC) co…

---

## [MPI framework for parallelized warmups](https://discourse.mc-stan.org/t/mpi-framework-for-parallelized-warmups/11671)

<div class="topic-metadata">

**Author:** [@yizhang](https://discourse.mc-stan.org/u/yizhang)\
**Replies:** 25\
**Last updated:** [December 7, 2019, 4:16am UTC](https://discourse.mc-stan.org/t/mpi-framework-for-parallelized-warmups/11671 "2019-12-07T04:16:21Z")

</div>

As mentioned at https://discourse.mc-stan.org/t/parallel-dynamic-hmc-merits/10895/13?u=yizhang we can improve adaptation by collecting adapt info from multiple chains during warmup. The following concept is an MPI framew…

---

## [HINTS: An alternative to NUTS that doesn't require gradients](https://discourse.mc-stan.org/t/hints-an-alternative-to-nuts-that-doesnt-require-gradients/10017)

<div class="topic-metadata">

**Author:** [@s.maskell](https://discourse.mc-stan.org/u/s.maskell)\
**Replies:** 40\
**Last updated:** [September 22, 2019, 11:02am UTC](https://discourse.mc-stan.org/t/hints-an-alternative-to-nuts-that-doesnt-require-gradients/10017 "2019-09-22T11:02:16Z")

</div>

Have Stan developers considered HINTS \[1\]? I fell that it’s an overly-obscure algorithm that obeys detailed balance, is efficient at sampling the typical set and doesn’t require gradients. It’s therefore a potentially us…

---

## [Covadapt: Low Rank covariance adaptation for high dimensional problems](https://discourse.mc-stan.org/t/covadapt-low-rank-covariance-adaptation-for-high-dimensional-problems/10870)

<div class="topic-metadata">

**Author:** [@aseyboldt](https://discourse.mc-stan.org/u/aseyboldt)\
**Replies:** 20\
**Last updated:** [September 14, 2019, 3:18pm UTC](https://discourse.mc-stan.org/t/covadapt-low-rank-covariance-adaptation-for-high-dimensional-problems/10870 "2019-09-14T15:18:38Z")

</div>

Hi everyone :-) I’m working on an algorithm for finding better approximations to the mass matrix, that still works in moderately high dimensional models. You can find an implementation for pymc3 here. It seems to be qu…

---

## [Confused about accept\_stat\_\_ and delta](https://discourse.mc-stan.org/t/confused-about-accept-stat-and-delta/9931)

<div class="topic-metadata">

**Author:** [@tpapp](https://discourse.mc-stan.org/u/tpapp)\
**Replies:** 10\
**Last updated:** [August 21, 2019, 3:56am UTC](https://discourse.mc-stan.org/t/confused-about-accept-stat-and-delta/9931 "2019-08-21T03:56:45Z")

</div>

I am tweaking a model and realized that I am confused about something fundamental. Reading the original Hoffman & Gelman (2014) NUTS paper, I was under the impression that what is called accept\_stat\_\_ in Stan is \\alpha /…

---

## [Question regarding the samplers at use for time-series models?](https://discourse.mc-stan.org/t/question-regarding-the-samplers-at-use-for-time-series-models/9231)

<div class="topic-metadata">

**Author:** [@Ging](https://discourse.mc-stan.org/u/Ging)\
**Replies:** 3\
**Last updated:** [July 1, 2019, 9:14pm UTC](https://discourse.mc-stan.org/t/question-regarding-the-samplers-at-use-for-time-series-models/9231 "2019-07-01T21:14:19Z")

</div>

Hello, all. I have long been a theoretical fan of Bayesian statistics, especially since I read McElreath’s Statistical Rethinking, and I finally want to get my feat wet with some actual modelling. What has drawn me to S…

---

## [Using a fixed step size for HMC (or NUTS) and other sampler options](https://discourse.mc-stan.org/t/using-a-fixed-step-size-for-hmc-or-nuts-and-other-sampler-options/6754)

<div class="topic-metadata">

**Author:** [@caesoma](https://discourse.mc-stan.org/u/caesoma)\
**Replies:** 21\
**Last updated:** [June 27, 2019, 1:38am UTC](https://discourse.mc-stan.org/t/using-a-fixed-step-size-for-hmc-or-nuts-and-other-sampler-options/6754 "2019-06-27T01:38:58Z")

</div>

Is it possible to completely fix the stepsize\_\_ parameter? Equivalently I tried to run the HMC sampler with warmup=0 but I got flat lines and zero-likelihood/negative poisson parameter warnings even when setting the init…

---

## [HMC (jittered) vs. NUTS on 1000-dimensional standard normal](https://discourse.mc-stan.org/t/hmc-jittered-vs-nuts-on-1000-dimensional-standard-normal/8383)

<div class="topic-metadata">

**Author:** [@Bob\_Carpenter](https://discourse.mc-stan.org/u/Bob_Carpenter)\
**Replies:** 9\
**Last updated:** [April 29, 2019, 10:23pm UTC](https://discourse.mc-stan.org/t/hmc-jittered-vs-nuts-on-1000-dimensional-standard-normal/8383 "2019-04-29T22:23:34Z")

</div>

This isn’t just about Stan algorithms. I wanted to evaluate Wu, Stoerer, and Robert. 2018. Faster Hamiltonian Monte Carlo by Learning Leapfrog Scale. arXiv. the punchline of the abstract says When compared with …

---

## [Subsampling in parallel and MCMC](https://discourse.mc-stan.org/t/subsampling-in-parallel-and-mcmc/8608)

<div class="topic-metadata">

**Author:** [@Bob\_Carpenter](https://discourse.mc-stan.org/u/Bob_Carpenter)\
**Replies:** 12\
**Last updated:** [April 29, 2019, 7:29pm UTC](https://discourse.mc-stan.org/t/subsampling-in-parallel-and-mcmc/8608 "2019-04-29T19:29:30Z")

</div>

I am working on lots of simulations and here’s a recent plot I came up with. Subsampling data and fitting each subsample separately leaves you with draws that are far away from the data resulting from the posterior t…

---

## [Using output from optimization algorithms to initialize sampler](https://discourse.mc-stan.org/t/using-output-from-optimization-algorithms-to-initialize-sampler/6969)

<div class="topic-metadata">

**Author:** [@Todor](https://discourse.mc-stan.org/u/Todor)\
**Replies:** 6\
**Last updated:** [April 25, 2019, 6:51pm UTC](https://discourse.mc-stan.org/t/using-output-from-optimization-algorithms-to-initialize-sampler/6969 "2019-04-25T18:51:03Z")

</div>

I’m trying to speed up model convergence, and am considering finding the posterior mode using Stan’s LBFGS routines, and then initializing the sampler chains with it, or a perturbation. At first glance, I would expect t…

---

## [Dual-averaging for other MCMC algorithms](https://discourse.mc-stan.org/t/dual-averaging-for-other-mcmc-algorithms/6307)

<div class="topic-metadata">

**Author:** [@maxbiostat](https://discourse.mc-stan.org/u/maxbiostat)\
**Replies:** 2\
**Last updated:** [November 2, 2018, 11:31am UTC](https://discourse.mc-stan.org/t/dual-averaging-for-other-mcmc-algorithms/6307 "2018-11-02T11:31:47Z")

</div>

This not a Stan question, but as have many others, I’m looking to take advantage of the remarkable concentration of smart people on this forum. Looking at you, @Bob\_Carpenter and @betanalpha . Would it (in principle) pa…

[Next page](https://discourse.mc-stan.org/tag/mcmc/19.md?match_all_tags=true&page=1&tags%5B%5D=mcmc)
