# \#stan

**URL:** https://discourse.mc-stan.org/tag/stan/43.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)

---

## [AutoStan: Can we automate (parts of) Bayesian workflow with coding agents?](https://discourse.mc-stan.org/t/autostan-can-we-automate-parts-of-bayesian-workflow-with-coding-agents/41028)

<div class="topic-metadata">

**Author:** [@Oliver\_Duerr](https://discourse.mc-stan.org/u/Oliver_Duerr)\
**Replies:** 4\
**Last updated:** [May 7, 2026, 12:04pm UTC](https://discourse.mc-stan.org/t/autostan-can-we-automate-parts-of-bayesian-workflow-with-coding-agents/41028 "2026-05-07T12:04:45Z")

</div>

Bayesian modeling with Stan is beautiful, principled, and powerful — but it requires a bit of babysitting and knowledge of the MCMC process. Divergences, R-hat, reparameterizations, … This gap between “just run lm()” and…

---

## [Short Course: Introduction to Bayesian Inference and Modelling](https://discourse.mc-stan.org/t/short-course-introduction-to-bayesian-inference-and-modelling/41088)

<div class="topic-metadata">

**Author:** [@UCLPG-MSC-SGDS](https://discourse.mc-stan.org/u/UCLPG-MSC-SGDS)\
**Replies:** 0\
**Last updated:** [April 30, 2026, 11:57am UTC](https://discourse.mc-stan.org/t/short-course-introduction-to-bayesian-inference-and-modelling/41088 "2026-04-30T11:57:45Z")

</div>

Hi everyone, I hope this message finds you well. I want to share that I will be running an introductory course on Bayesian Inference and Modelling in Stan. It will be a 4-day in-person programme designed for academics …

---

## [Binomial GLMM Assumptions](https://discourse.mc-stan.org/t/binomial-glmm-assumptions/30254)

<div class="topic-metadata">

**Author:** [@Hunter24](https://discourse.mc-stan.org/u/Hunter24)\
**Replies:** 15\
**Last updated:** [January 28, 2026, 6:40pm UTC](https://discourse.mc-stan.org/t/binomial-glmm-assumptions/30254 "2026-01-28T18:40:27Z")

</div>

I am using a binomial GLMM and am confused on how to test for homoscedasticity of residuals. When I use normal difference residuals it shows heteroscedasticity, but when I use pearsons residuals it shows more of a homos…

---

## [Followup, advanced online Stan course: ~20 hours of videos, live-coding + commentary](https://discourse.mc-stan.org/t/followup-advanced-online-stan-course-20-hours-of-videos-live-coding-commentary/39618)

<div class="topic-metadata">

**Author:** [@ssp3nc3r](https://discourse.mc-stan.org/u/ssp3nc3r)\
**Replies:** 1\
**Last updated:** [May 31, 2025, 2:03am UTC](https://discourse.mc-stan.org/t/followup-advanced-online-stan-course-20-hours-of-videos-live-coding-commentary/39618 "2025-05-31T02:03:23Z")

</div>

Hello all! Please pardon a little self-promotion. :) My second, advanced Stan course is ready! This course continues from where my first course ended (forum discussion), and took almost a year to develop the additiona…

---

## [New online Stan coding course: 80 videos + hosted live coding environment](https://discourse.mc-stan.org/t/new-online-stan-coding-course-80-videos-hosted-live-coding-environment/35528)

<div class="topic-metadata">

**Author:** [@ssp3nc3r](https://discourse.mc-stan.org/u/ssp3nc3r)\
**Replies:** 7\
**Last updated:** [November 28, 2024, 5:03pm UTC](https://discourse.mc-stan.org/t/new-online-stan-coding-course-80-videos-hosted-live-coding-environment/35528 "2024-11-28T17:03:50Z")

</div>

Hey everyone! Please pardon the self-promotion. :) I’m excited to announce my new online course for learning direct Stan coding for Bayesian analysis. Available starting this Friday; you can enroll here: https://athlytic…

---

## [Use of ~ for overloaded distribution statements?](https://discourse.mc-stan.org/t/use-of-for-overloaded-distribution-statements/37238)

<div class="topic-metadata">

**Author:** [@ssp3nc3r](https://discourse.mc-stan.org/u/ssp3nc3r)\
**Replies:** 8\
**Last updated:** [November 13, 2024, 5:35pm UTC](https://discourse.mc-stan.org/t/use-of-for-overloaded-distribution-statements/37238 "2024-11-13T17:35:38Z")

</div>

While I can successfully overload distribution statements, if I use the ~ syntax instead of target, the compiler throws a syntax error: functions { real distribution\_lpdf(vector y, real mu, real sigma) { return…

---

## [Failed to Execute Stan's \`runTests.py\` on WSL2](https://discourse.mc-stan.org/t/failed-to-execute-stans-runtests-py-on-wsl2/36242)

<div class="topic-metadata">

**Author:** [@CLRR](https://discourse.mc-stan.org/u/CLRR)\
**Replies:** 6\
**Last updated:** [August 16, 2024, 2:41pm UTC](https://discourse.mc-stan.org/t/failed-to-execute-stans-runtests-py-on-wsl2/36242 "2024-08-16T14:41:34Z")

</div>

I previously reported that I failed to fit a model using CmdStanR on the GPU with OpenCL on WSL2, encountering the error Chain \<CHAIN\_NUMBER\> OpenCL Initialization: \[Device\] CL\_INVALID\_DEVICE: Unknown error -1, in this t…

---

## [Modleing systematic error issue in STAN](https://discourse.mc-stan.org/t/modleing-systematic-error-issue-in-stan/36113)

<div class="topic-metadata">

**Author:** [@ssalimi](https://discourse.mc-stan.org/u/ssalimi)\
**Replies:** 11\
**Last updated:** [August 8, 2024, 9:42pm UTC](https://discourse.mc-stan.org/t/modleing-systematic-error-issue-in-stan/36113 "2024-08-08T21:42:30Z")

</div>

Hello, I have a variable/feature measured which has a systematic error. I want to model its systematic error and estimate/predict true measurement. I modled as below but I am not sure if it is correct. I wonder if I nee…

---

## [Pathfinder determines inits for simplex with the sum not equal one](https://discourse.mc-stan.org/t/pathfinder-determines-inits-for-simplex-with-the-sum-not-equal-one/35230)

<div class="topic-metadata">

**Author:** [@aakhmetz](https://discourse.mc-stan.org/u/aakhmetz)\
**Replies:** 5\
**Last updated:** [July 4, 2024, 5:47am UTC](https://discourse.mc-stan.org/t/pathfinder-determines-inits-for-simplex-with-the-sum-not-equal-one/35230 "2024-07-04T05:47:16Z")

</div>

Hello all, I am not sure if it’s a bug or no, but when I used pathfinder to set initial conditions as it is described in the manual of cmdstan, one of my variables was the weight for the mixture model, given by a simple…

---

## [Good R-hat, good n\_eff but large se\_mean and sd!](https://discourse.mc-stan.org/t/good-r-hat-good-n-eff-but-large-se-mean-and-sd/35274)

<div class="topic-metadata">

**Author:** [@rmrmasoomi](https://discourse.mc-stan.org/u/rmrmasoomi)\
**Replies:** 0\
**Last updated:** [May 27, 2024, 2:32pm UTC](https://discourse.mc-stan.org/t/good-r-hat-good-n-eff-but-large-se-mean-and-sd/35274 "2024-05-27T14:32:35Z")

</div>

Hi everyone, I am trying to fit an SEIR model to influenza data. In the data, I have the incidence of newly reported cases per week. In my Stan model, I simulated the SEIR model per day and then aggregated the data per …

---

## [Intended behavior of vector\[array\_idx\] += vector?](https://discourse.mc-stan.org/t/intended-behavior-of-vector-array-idx-vector/33990)

<div class="topic-metadata">

**Author:** [@ssp3nc3r](https://discourse.mc-stan.org/u/ssp3nc3r)\
**Replies:** 1\
**Last updated:** [January 31, 2024, 8:51pm UTC](https://discourse.mc-stan.org/t/intended-behavior-of-vector-array-idx-vector/33990 "2024-01-31T20:51:38Z")

</div>

Stan allows us to index each element of a vector multiple times, and allows us to assign that indexed element some values. Using this toy syntax below, I intend to increment an element five times, but it occurs only on…

---

## [How to fit a distribution given an empirical CDF?](https://discourse.mc-stan.org/t/how-to-fit-a-distribution-given-an-empirical-cdf/33889)

<div class="topic-metadata">

**Author:** [@qdread](https://discourse.mc-stan.org/u/qdread)\
**Replies:** 6\
**Last updated:** [January 20, 2024, 12:12pm UTC](https://discourse.mc-stan.org/t/how-to-fit-a-distribution-given-an-empirical-cdf/33889 "2024-01-20T12:12:38Z")

</div>

I have data on the distribution of particle sizes. There are several treatments (in the example data I just provide one treatment, dose, with two levels for simplicity). Within each treatment, there are three replicates r…

---

## [Calculating the pointwise log-likelihood in a two-staged multilevel model](https://discourse.mc-stan.org/t/calculating-the-pointwise-log-likelihood-in-a-two-staged-multilevel-model/33562)

<div class="topic-metadata">

**Author:** [@Unlearned5341](https://discourse.mc-stan.org/u/Unlearned5341)\
**Replies:** 1\
**Last updated:** [December 13, 2023, 10:02pm UTC](https://discourse.mc-stan.org/t/calculating-the-pointwise-log-likelihood-in-a-two-staged-multilevel-model/33562 "2023-12-13T22:02:42Z")

</div>

In order to use loo, I want to calculate the pointwise log-likelihood in a two-staged multilevel model; however, I am not sure about the correct way to do it. Let’s take the example from Overcoming the Simpson's paradox…

---

## [How to use prior from a sample?](https://discourse.mc-stan.org/t/how-to-use-prior-from-a-sample/33129)

<div class="topic-metadata">

**Author:** [@deltasata](https://discourse.mc-stan.org/u/deltasata)\
**Replies:** 5\
**Last updated:** [October 25, 2023, 12:54pm UTC](https://discourse.mc-stan.org/t/how-to-use-prior-from-a-sample/33129 "2023-10-25T12:54:51Z")

</div>

Hi, I want to fit with 20 parameters. For 5 of them I want to use a prior drawn from a 5D sample (I got this from a previous fit). I emphasize that my priors are not simple analytical functions, rather I have this 5D sa…

---

## [Comparison of two model BYM and BYM2](https://discourse.mc-stan.org/t/comparison-of-two-model-bym-and-bym2/30443)

<div class="topic-metadata">

**Author:** [@shayeste](https://discourse.mc-stan.org/u/shayeste)\
**Replies:** 10\
**Last updated:** [February 21, 2023, 6:18pm UTC](https://discourse.mc-stan.org/t/comparison-of-two-model-bym-and-bym2/30443 "2023-02-21T18:18:20Z")

</div>

hi everyone, hope you are doing well, I have implemented two models bym and bym2 in open bugs and rstudio ,respectively. now , what solution do you suggest for me to compare the two models? considering that each of the…

---

## [Modeling heteroskedasticity using the auxiliary parameter phi for beta\_binomial distribution](https://discourse.mc-stan.org/t/modeling-heteroskedasticity-using-the-auxiliary-parameter-phi-for-beta-binomial-distribution/30255)

<div class="topic-metadata">

**Author:** [@Hunter24](https://discourse.mc-stan.org/u/Hunter24)\
**Replies:** 13\
**Last updated:** [February 13, 2023, 8:20pm UTC](https://discourse.mc-stan.org/t/modeling-heteroskedasticity-using-the-auxiliary-parameter-phi-for-beta-binomial-distribution/30255 "2023-02-13T20:20:20Z")

</div>

I am working with high resolution social network data that recorded interactions every second. I want to look at what predicts the association rate of the following day during the breeding season. My response variables…

---

## [Defining a hierarchical GEV with a modified Beta prior](https://discourse.mc-stan.org/t/defining-a-hierarchical-gev-with-a-modified-beta-prior/29725)

<div class="topic-metadata">

**Author:** [@Alex\_Lee](https://discourse.mc-stan.org/u/Alex_Lee)\
**Replies:** 2\
**Last updated:** [January 8, 2023, 3:55pm UTC](https://discourse.mc-stan.org/t/defining-a-hierarchical-gev-with-a-modified-beta-prior/29725 "2023-01-08T15:55:07Z")

</div>

I’ve defined a hierarchical generalized extreme value distribution and I’m trying to implement a beta distribution with a slight modification as a prior for this. The beta distribution is: Beta(\\theta+0.5|p,q) = (0.5 …

---

## [Bayesian Mixture Model](https://discourse.mc-stan.org/t/bayesian-mixture-model/29896)

<div class="topic-metadata">

**Author:** [@DIVAGORA](https://discourse.mc-stan.org/u/DIVAGORA)\
**Replies:** 2\
**Last updated:** [December 29, 2022, 7:35am UTC](https://discourse.mc-stan.org/t/bayesian-mixture-model/29896 "2022-12-29T07:35:51Z")

</div>

I’m newbie using STAN. I’m trying to perform a Bayesian mixture model (mixing Gaussian and GEV distributions). However, the model has convergence problem. Any comments on improving it.Thanks! functions{ real gev…

---

## [Covariance Matrix not symmetric](https://discourse.mc-stan.org/t/covariance-matrix-not-symmetric/29824)

<div class="topic-metadata">

**Author:** [@magiceule19](https://discourse.mc-stan.org/u/magiceule19)\
**Replies:** 4\
**Last updated:** [December 23, 2022, 7:58pm UTC](https://discourse.mc-stan.org/t/covariance-matrix-not-symmetric/29824 "2022-12-23T19:58:04Z")

</div>

Hi, I am receiving an Informational message that the scale parameter is not symmetric and that the covariance matrix is not symmetric. It looks like this the warning ( the code works fine) as below. I am using symmetri…

---

## [Problem running stan() function. October 2022. R version 4.2.1. Windows 10](https://discourse.mc-stan.org/t/problem-running-stan-function-october-2022-r-version-4-2-1-windows-10/29199)

<div class="topic-metadata">

**Author:** [@Salvador\_Rodriguez](https://discourse.mc-stan.org/u/Salvador_Rodriguez)\
**Replies:** 3\
**Last updated:** [October 19, 2022, 8:36pm UTC](https://discourse.mc-stan.org/t/problem-running-stan-function-october-2022-r-version-4-2-1-windows-10/29199 "2022-10-19T20:36:15Z")

</div>

I am unable to run the stan function from the rstan package. I get the next error: \*Error in compileCode(f, code, language = language, verbose = verbose) : \* \* C:\\rtools42\\x86\_64-w64-mingw32.static.posix\\bin/ld.exe: fi…

---

## [A quick question about qr\_thin\_Q](https://discourse.mc-stan.org/t/a-quick-question-about-qr-thin-q/29126)

<div class="topic-metadata">

**Author:** [@Michelle](https://discourse.mc-stan.org/u/Michelle)\
**Replies:** 0\
**Last updated:** [October 13, 2022, 11:35am UTC](https://discourse.mc-stan.org/t/a-quick-question-about-qr-thin-q/29126 "2022-10-13T11:35:11Z")

</div>

Hello, May I ask a quick question about Stan QR function qr\_thin\_Q? Is it the same as Gram-Schmidt orthogonalization except for the standardization of each column? For instance, a1 (Nx1) (1st column) of matrix qr\_thin\_Q…

---

## [Lognormal vs shifted\_lognormal vs GEV measurement error models in brms](https://discourse.mc-stan.org/t/lognormal-vs-shifted-lognormal-vs-gev-measurement-error-models-in-brms/28657)

<div class="topic-metadata">

**Author:** [@stu.donovan](https://discourse.mc-stan.org/u/stu.donovan)\
**Replies:** 4\
**Last updated:** [September 19, 2022, 1:37am UTC](https://discourse.mc-stan.org/t/lognormal-vs-shifted-lognormal-vs-gev-measurement-error-models-in-brms/28657 "2022-09-19T01:37:07Z")

</div>

I’m estimating a model that consists of four equations: One binomial equation in y that has three explanatory variables, x1, x2, and x3, which are measured with error. As the three explanatory variables are bounded to be…

---

## [Report bym in openbugs . mc-error , val97,5 pc , running quantiles,auto-corrolation](https://discourse.mc-stan.org/t/report-bym-in-openbugs-mc-error-val97-5-pc-running-quantiles-auto-corrolation/28782)

<div class="topic-metadata">

**Author:** [@shayeste](https://discourse.mc-stan.org/u/shayeste)\
**Replies:** 4\
**Last updated:** [September 14, 2022, 9:00pm UTC](https://discourse.mc-stan.org/t/report-bym-in-openbugs-mc-error-val97-5-pc-running-quantiles-auto-corrolation/28782 "2022-09-14T21:00:06Z")

</div>

hi everyone, my friends, I’m having trouble reporting bym results in open bugs and I’m confused. can you guide me in reporting MC\_error and val97.5pc in below? mean sd MC\_erro val2.5pc media…

---

## [Bym model](https://discourse.mc-stan.org/t/bym-model/28603)

<div class="topic-metadata">

**Author:** [@shayeste](https://discourse.mc-stan.org/u/shayeste)\
**Replies:** 11\
**Last updated:** [August 26, 2022, 7:52pm UTC](https://discourse.mc-stan.org/t/bym-model/28603 "2022-08-26T19:52:13Z")

</div>

hi all , I want to run the bym model using open bugs. in the BYM model, I want to remove a province from among the neighbors, what code should I use? and how is the work report of bym? can you guide me?

---

## [Chain 1: Log probability evaluates to log(0), i.e. negative infinity. What is causing this error?](https://discourse.mc-stan.org/t/chain-1-log-probability-evaluates-to-log-0-i-e-negative-infinity-what-is-causing-this-error/28173)

<div class="topic-metadata">

**Author:** [@GabrielSass](https://discourse.mc-stan.org/u/GabrielSass)\
**Replies:** 1\
**Last updated:** [July 15, 2022, 8:49pm UTC](https://discourse.mc-stan.org/t/chain-1-log-probability-evaluates-to-log-0-i-e-negative-infinity-what-is-causing-this-error/28173 "2022-07-15T20:49:20Z")

</div>

Hello, I am running the following model: // generated with brms 2.17.0 functions { /\* hurdle lognormal log-PDF of a single response \* logit parameterization of the hurdle part \* Args: \* y: the response val…

---

## [Ordered\_logistic\_glm\_lpmf() availability and documentation?](https://discourse.mc-stan.org/t/ordered-logistic-glm-lpmf-availability-and-documentation/27876)

<div class="topic-metadata">

**Author:** [@ssp3nc3r](https://discourse.mc-stan.org/u/ssp3nc3r)\
**Replies:** 1\
**Last updated:** [June 18, 2022, 7:51am UTC](https://discourse.mc-stan.org/t/ordered-logistic-glm-lpmf-availability-and-documentation/27876 "2022-06-18T07:51:41Z")

</div>

The Stan User Guide lists ordered\_logistic\_glm\_lpmf()as an available function to run on a GPU, But I cannot find documentation of the function in the Functions Reference. The Functions reference guide throws an error …

---

## [How do we obtain the response value estimates from a stanfit object just as we would get from the function conditional\_effect() with a brmsfit object?](https://discourse.mc-stan.org/t/how-do-we-obtain-the-response-value-estimates-from-a-stanfit-object-just-as-we-would-get-from-the-function-conditional-effect-with-a-brmsfit-object/27740)

<div class="topic-metadata">

**Author:** [@GabrielSass](https://discourse.mc-stan.org/u/GabrielSass)\
**Replies:** 0\
**Last updated:** [June 6, 2022, 6:01pm UTC](https://discourse.mc-stan.org/t/how-do-we-obtain-the-response-value-estimates-from-a-stanfit-object-just-as-we-would-get-from-the-function-conditional-effect-with-a-brmsfit-object/27740 "2022-06-06T18:01:57Z")

</div>

Hi, I am wondering if it is possible to obtain response value estimates (estimate\_\_ column) that you obtain when doing conditional\_effects(brmsfit) but if instead of a brmsfit object, I only have a stanfit object. I am …

---

## [After trying to update brms cannot run model](https://discourse.mc-stan.org/t/after-trying-to-update-brms-cannot-run-model/20659)

<div class="topic-metadata">

**Author:** [@Rokh42](https://discourse.mc-stan.org/u/Rokh42)\
**Replies:** 8\
**Last updated:** [May 3, 2022, 8:30pm UTC](https://discourse.mc-stan.org/t/after-trying-to-update-brms-cannot-run-model/20659 "2022-05-03T20:30:05Z")

</div>

Hello, I recently tried to update brms updating using this command if (!requireNamespace("devtools")) { install.packages("devtools") } devtools::install\_github("paul-buerkner/brms")\`\`\` And somehow after doing this, I…

---

## [Understanding the Stan code base - A blog post series](https://discourse.mc-stan.org/t/understanding-the-stan-code-base-a-blog-post-series/25517)

<div class="topic-metadata">

**Author:** [@jtimonen](https://discourse.mc-stan.org/u/jtimonen)\
**Replies:** 1\
**Last updated:** [January 14, 2022, 4:36am UTC](https://discourse.mc-stan.org/t/understanding-the-stan-code-base-a-blog-post-series/25517 "2022-01-14T04:36:59Z")

</div>

I have for some time wanted to understand the rather large C++ source code base of Stan. I created a blog post about studying it at https://jtimonen.github.io/posts/post-01/ and it is supposed to be part of a series that…

---

## [Stan-dev/stan tests: generating .hpp from .stan files](https://discourse.mc-stan.org/t/stan-dev-stan-tests-generating-hpp-from-stan-files/25888)

<div class="topic-metadata">

**Author:** [@syclik](https://discourse.mc-stan.org/u/syclik)\
**Replies:** 9\
**Last updated:** [January 6, 2022, 7:15pm UTC](https://discourse.mc-stan.org/t/stan-dev-stan-tests-generating-hpp-from-stan-files/25888 "2022-01-06T19:15:14Z")

</div>

Hi all, I was trying to run some tests locally and ran into problems. From a clean clone of Stan, this is what I’m seeing: \> ./runTests.py src/test/unit/services/optimize/bfgs\_test.cpp ---------------------------------…

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