# \#bug

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

---

## [Can't compile a simple C file with Rstan on MacOS Sonoma 14.5](https://discourse.mc-stan.org/t/cant-compile-a-simple-c-file-with-rstan-on-macos-sonoma-14-5/35826)

<div class="topic-metadata">

**Author:** [@Xavier\_La\_Rochelle](https://discourse.mc-stan.org/u/Xavier_La_Rochelle)\
**Replies:** 3\
**Last updated:** [July 15, 2024, 6:34pm UTC](https://discourse.mc-stan.org/t/cant-compile-a-simple-c-file-with-rstan-on-macos-sonoma-14-5/35826 "2024-07-15T18:34:10Z")

</div>

I recently updated my mac (intel) to Sonoma 14.5 and updated R to 4.4.0 and I can’t compile a stan model with Rstan anymore. I’ve been looking at different threads online but nothing seems to work. library(rstan) n \<- …

---

## [Differing behaviour when using explicit vs implicit ints?](https://discourse.mc-stan.org/t/differing-behaviour-when-using-explicit-vs-implicit-ints/35526)

<div class="topic-metadata">

**Author:** [@jaburgoyne](https://discourse.mc-stan.org/u/jaburgoyne)\
**Replies:** 8\
**Last updated:** [June 21, 2024, 7:10pm UTC](https://discourse.mc-stan.org/t/differing-behaviour-when-using-explicit-vs-implicit-ints/35526 "2024-06-21T19:10:29Z")

</div>

While using a custom probability density function, I’m seeing different behaviour from Stan (cmdstanr interface on an M1 Mac) depending on whether I specify an integer term explicitly as a local variable declaration or s…

---

## [Problem with brms multithreading on mac](https://discourse.mc-stan.org/t/problem-with-brms-multithreading-on-mac/33970)

<div class="topic-metadata">

**Author:** [@daniel-trejobanos](https://discourse.mc-stan.org/u/daniel-trejobanos)\
**Replies:** 6\
**Last updated:** [March 13, 2024, 10:15pm UTC](https://discourse.mc-stan.org/t/problem-with-brms-multithreading-on-mac/33970 "2024-03-13T22:15:53Z")

</div>

Short summary of the problem \> oa\_base \<- bf(Y ~ 1 + HOA\_adj +OOAtot\_adj + BBOA\_adj ) \> brm(oa\_base, data=data, family=lognormal(),threads=6, chains=1, iter=2000, backend="cmdstanr") Syntax error in '/var/folders/dm/b7…

---

## [Divergence check does not satisfy time-reversibility](https://discourse.mc-stan.org/t/divergence-check-does-not-satisfy-time-reversibility/33738)

<div class="topic-metadata">

**Author:** [@howsiyu](https://discourse.mc-stan.org/u/howsiyu)\
**Replies:** 1\
**Last updated:** [January 7, 2024, 11:46am UTC](https://discourse.mc-stan.org/t/divergence-check-does-not-satisfy-time-reversibility/33738 "2024-01-07T11:46:10Z")

</div>

Hi, I’m aware that Stan does not use slice sampler in the NUTS paper but sample directly from the probabilities. However, u in the paper is also used to check divergence while current Stan code just use the initial ener…

---

## [Issue with "make" command using brms package](https://discourse.mc-stan.org/t/issue-with-make-command-using-brms-package/32791)

<div class="topic-metadata">

**Author:** [@tjshaw28](https://discourse.mc-stan.org/u/tjshaw28)\
**Replies:** 2\
**Last updated:** [September 18, 2023, 3:28pm UTC](https://discourse.mc-stan.org/t/issue-with-make-command-using-brms-package/32791 "2023-09-18T15:28:31Z")

</div>

Hi all, I am looking to execute some bayesian multilevel models in R. I have the rstan, rstanheaders, and rstantools installed, as well as rtools 43, and R version 4.2.3 (2023-03-15 ucrt). My model code is pictured belo…

---

## [Minimizing warmup iterations - Error reading step size from CmdStan output](https://discourse.mc-stan.org/t/minimizing-warmup-iterations-error-reading-step-size-from-cmdstan-output/32424)

<div class="topic-metadata">

**Author:** [@siliz4](https://discourse.mc-stan.org/u/siliz4)\
**Replies:** 4\
**Last updated:** [August 15, 2023, 2:52pm UTC](https://discourse.mc-stan.org/t/minimizing-warmup-iterations-error-reading-step-size-from-cmdstan-output/32424 "2023-08-15T14:52:16Z")

</div>

I’m working on a model with a highly multimodal posterior and it seems like the geometry is too complex for Stan (namely, it warns me that it reaches the max treedepth at each iteration). For this reason, I use a Metropo…

---

## [Error from Stan parser for brms negbinomial distributional model with missing values](https://discourse.mc-stan.org/t/error-from-stan-parser-for-brms-negbinomial-distributional-model-with-missing-values/30011)

<div class="topic-metadata">

**Author:** [@jd\_c](https://discourse.mc-stan.org/u/jd_c)\
**Replies:** 3\
**Last updated:** [January 11, 2023, 1:20pm UTC](https://discourse.mc-stan.org/t/error-from-stan-parser-for-brms-negbinomial-distributional-model-with-missing-values/30011 "2023-01-11T13:20:48Z")

</div>

Howdy. Has anyone else run into an error from the Stan parser when trying to fit a negative binomial distributional model where there is a rate offset and there are missing values in the predictors? I am using brms vers…

---

## [Does brms ever fit using a negative sigma?](https://discourse.mc-stan.org/t/does-brms-ever-fit-using-a-negative-sigma/29500)

<div class="topic-metadata">

**Author:** [@t-pollington](https://discourse.mc-stan.org/u/t-pollington)\
**Replies:** 4\
**Last updated:** [November 16, 2022, 3:30pm UTC](https://discourse.mc-stan.org/t/does-brms-ever-fit-using-a-negative-sigma/29500 "2022-11-16T15:30:23Z")

</div>

I have defined sigma inside my formula as: bf(...) + nlf(sigma ~ sigmaA + sigmaB \* exp(sigmaC \* y)) + lf(sigmaA + sigmaB + sigmaC ~ 1) and inside my priors sigmaA is unbounded while sigmaB & sigmaC are positive. The p…

---

## [Problems when running pystan on windows 10](https://discourse.mc-stan.org/t/problems-when-running-pystan-on-windows-10/28544)

<div class="topic-metadata">

**Author:** [@richardhansson](https://discourse.mc-stan.org/u/richardhansson)\
**Replies:** 4\
**Last updated:** [August 16, 2022, 8:41am UTC](https://discourse.mc-stan.org/t/problems-when-running-pystan-on-windows-10/28544 "2022-08-16T08:41:04Z")

</div>

I been trying to get pystan working for quite a while on windows 10. An package called orbit relies heavily on it and i am trying to use it without luck where the errors always appears upstream in stan. Operating syste…

---

## [Persistent ghost parser error in Stan model](https://discourse.mc-stan.org/t/persistent-ghost-parser-error-in-stan-model/27806)

<div class="topic-metadata">

**Author:** [@PiscisBailey](https://discourse.mc-stan.org/u/PiscisBailey)\
**Replies:** 1\
**Last updated:** [June 12, 2022, 10:06pm UTC](https://discourse.mc-stan.org/t/persistent-ghost-parser-error-in-stan-model/27806 "2022-06-12T22:06:47Z")

</div>

I updated Rstudio and suddenly a model that ran with no issue before is throwing non-sensical parser errors. I have tried running other models that have also previously ran and they are all throwing the same parser error…

---

## [Unserialize(socklist\[\[1\]\]) error on Mac Catalina](https://discourse.mc-stan.org/t/unserialize-socklist-1-error-on-mac-catalina/23862)

<div class="topic-metadata">

**Author:** [@mark.b](https://discourse.mc-stan.org/u/mark.b)\
**Replies:** 4\
**Last updated:** [August 25, 2021, 1:53pm UTC](https://discourse.mc-stan.org/t/unserialize-socklist-1-error-on-mac-catalina/23862 "2021-08-25T13:53:56Z")

</div>

I’m running into the well-known unserialize(socklist\[\[1\]\]) error: Error in unserialize(socklist\[\[n\]\]) : error reading from connection None of the posted fixes have worked for me: I don’t appear to have a Makevars file…

---

## [New error: cleanup\_makevar(old) : argument "RMU" is missing, with no default](https://discourse.mc-stan.org/t/new-error-cleanup-makevar-old-argument-rmu-is-missing-with-no-default/18137)

<div class="topic-metadata">

**Author:** [@jkalley](https://discourse.mc-stan.org/u/jkalley)\
**Replies:** 74\
**Last updated:** [June 28, 2021, 1:39am UTC](https://discourse.mc-stan.org/t/new-error-cleanup-makevar-old-argument-rmu-is-missing-with-no-default/18137 "2021-06-28T01:39:33Z")

</div>

Hi all, After moving to R 4.0 and the most recent version of STAN, I’m getting a really strange error while trying to compile using stan\_model. The process throws an error with: Error in cleanup\_makevar(old) : argument…

---

## [Ragged arrays bug in the language](https://discourse.mc-stan.org/t/ragged-arrays-bug-in-the-language/12566)

<div class="topic-metadata">

**Author:** [@Bob\_Carpenter](https://discourse.mc-stan.org/u/Bob_Carpenter)\
**Replies:** 10\
**Last updated:** [May 28, 2021, 2:55am UTC](https://discourse.mc-stan.org/t/ragged-arrays-bug-in-the-language/12566 "2021-05-28T02:55:44Z")

</div>

We’ll be adding ragged arrays to Stan this year, so we should be able to remove the hacks for ragged arrays and replace them with proper solutions. At that point, I’m going to argue very strongly that we should fix the …

---

## [New Error in RStan](https://discourse.mc-stan.org/t/new-error-in-rstan/21248)

<div class="topic-metadata">

**Author:** [@kartermycroft](https://discourse.mc-stan.org/u/kartermycroft)\
**Replies:** 4\
**Last updated:** [March 12, 2021, 8:57pm UTC](https://discourse.mc-stan.org/t/new-error-in-rstan/21248 "2021-03-12T20:57:34Z")

</div>

Hi all, I posted about a bug I was having with Rstan recently (the infamous ‘cannot allocate vector’ error) and received very helpful responses here which solved the problem. Unfortunately, I’ve just come across a new e…

---

## [Predict error when using subset for the outcome and mi for a covariate](https://discourse.mc-stan.org/t/predict-error-when-using-subset-for-the-outcome-and-mi-for-a-covariate/19865)

<div class="topic-metadata">

**Author:** [@rexdouglass](https://discourse.mc-stan.org/u/rexdouglass)\
**Replies:** 2\
**Last updated:** [December 21, 2020, 7:43pm UTC](https://discourse.mc-stan.org/t/predict-error-when-using-subset-for-the-outcome-and-mi-for-a-covariate/19865 "2020-12-21T19:43:14Z")

</div>

Predicting a response when the outcome is subset and a covariate has missingness handled by mi throws an error “Error in as\_draws\_matrix(sdata\[\[paste0(“Y\_”, vmi)\]\], dim) : length(x) %in% c(1, dim\[2\]) is not TRUE” This…

---

## [Forecasting model does not contain samples](https://discourse.mc-stan.org/t/forecasting-model-does-not-contain-samples/19374)

<div class="topic-metadata">

**Author:** [@gregly](https://discourse.mc-stan.org/u/gregly)\
**Replies:** 2\
**Last updated:** [November 19, 2020, 10:07pm UTC](https://discourse.mc-stan.org/t/forecasting-model-does-not-contain-samples/19374 "2020-11-19T22:07:40Z")

</div>

Hello, I am struggling to get a forecasting model to run in Stan. The situation is that I need to predict monthly sales of a consumable item. The data I have to use is the monthly sales of units that consume the item an…

---

## [Silently ignored error when specifying init values](https://discourse.mc-stan.org/t/silently-ignored-error-when-specifying-init-values/18705)

<div class="topic-metadata">

**Author:** [@janfreyberg](https://discourse.mc-stan.org/u/janfreyberg)\
**Replies:** 8\
**Last updated:** [October 21, 2020, 12:07am UTC](https://discourse.mc-stan.org/t/silently-ignored-error-when-specifying-init-values/18705 "2020-10-21T00:07:27Z")

</div>

Hi, I’ve been trying to fix initialisation errors in a wiener family model, where there are multiple constraints (such as the non-decision time being lower than the smallest observed outcome). However, I noticed that…

---

## [Problem with posterior\_predict(..., nsamples=1) for categorical brms model](https://discourse.mc-stan.org/t/problem-with-posterior-predict-nsamples-1-for-categorical-brms-model/18463)

<div class="topic-metadata">

**Author:** [@pdonner](https://discourse.mc-stan.org/u/pdonner)\
**Replies:** 2\
**Last updated:** [October 7, 2020, 12:46pm UTC](https://discourse.mc-stan.org/t/problem-with-posterior-predict-nsamples-1-for-categorical-brms-model/18463 "2020-10-07T12:46:09Z")

</div>

Hi, I am getting this error: Error in insert\_refcat(eta, family = prep$family) : is.matrix(eta) is not TRUE When trying to predict one new sample, not with more samples, with this model: dat \<- data.frame(x=as.fac…

---

## [New Error: 'C:/rtools40/usr/mingw\_/bin/g++' not found; Allocating Large Vector](https://discourse.mc-stan.org/t/new-error-c-rtools40-usr-mingw-bin-g-not-found-allocating-large-vector/18146)

<div class="topic-metadata">

**Author:** [@kartermycroft](https://discourse.mc-stan.org/u/kartermycroft)\
**Replies:** 6\
**Last updated:** [September 23, 2020, 12:45am UTC](https://discourse.mc-stan.org/t/new-error-c-rtools40-usr-mingw-bin-g-not-found-allocating-large-vector/18146 "2020-09-23T00:45:29Z")

</div>

Hello all, I just today updated to R 4.0, RTools40, and the latest version of RStudio. After installing those, I also installed the rstan and StanHeaders packages from source. I’m now running into some curious issues try…

---

## [Unexpected integer overflow](https://discourse.mc-stan.org/t/unexpected-integer-overflow/17152)

<div class="topic-metadata">

**Author:** [@Dan\_Cervone](https://discourse.mc-stan.org/u/Dan_Cervone)\
**Replies:** 3\
**Last updated:** [August 2, 2020, 12:28pm UTC](https://discourse.mc-stan.org/t/unexpected-integer-overflow/17152 "2020-08-02T12:28:08Z")

</div>

With the following model (if you can even call it that): model { for(k in 1:10) { print(k - 10); } } The output represents what appears to be integer overflow. I am using cmdstanr\_0.0.0.9008 with stan 2…

---

## [Integer overflow when using loo\_moment\_match](https://discourse.mc-stan.org/t/integer-overflow-when-using-loo-moment-match/16691)

<div class="topic-metadata">

**Author:** [@trinhdhk](https://discourse.mc-stan.org/u/trinhdhk)\
**Replies:** 5\
**Last updated:** [July 24, 2020, 7:46am UTC](https://discourse.mc-stan.org/t/integer-overflow-when-using-loo-moment-match/16691 "2020-07-24T07:46:07Z")

</div>

Problem: Integer Overflow when using loo\_moment\_match() github issue: https://github.com/stan-dev/loo/issues/151 What I did: loo\_moment\_match for a stanfit model, following the vignette here, with all default parame…

---

## [Contrasts problem with "reloo" and "kfold"](https://discourse.mc-stan.org/t/contrasts-problem-with-reloo-and-kfold/16171)

<div class="topic-metadata">

**Author:** [@ldeschamps](https://discourse.mc-stan.org/u/ldeschamps)\
**Replies:** 3\
**Last updated:** [July 1, 2020, 1:08pm UTC](https://discourse.mc-stan.org/t/contrasts-problem-with-reloo-and-kfold/16171 "2020-07-01T13:08:53Z")

</div>

Hello! I am unable to compute grouped kfold cross validation with brms and develop version of rstan. EDIT : It happens also when I use reloo = T in case of too high pareto k values in loo. Here is a minimal reproducib…

---

## [Cmdstanr compilation error when using std\_normal\_lpdf](https://discourse.mc-stan.org/t/cmdstanr-compilation-error-when-using-std-normal-lpdf/16295)

<div class="topic-metadata">

**Author:** [@josh\_fiechter](https://discourse.mc-stan.org/u/josh_fiechter)\
**Replies:** 2\
**Last updated:** [June 30, 2020, 2:06am UTC](https://discourse.mc-stan.org/t/cmdstanr-compilation-error-when-using-std-normal-lpdf/16295 "2020-06-30T02:06:27Z")

</div>

When I include the std\_normal\_lpdf function in my Stan code, cmdstan\_model() won’t compile the script and gives me a warning saying that I need a “|” between the first two arguments of any “\_lpdf” function. But std\_norma…

---

## [The result of integrate\_1d is confusing](https://discourse.mc-stan.org/t/the-result-of-integrate-1d-is-confusing/15391)

<div class="topic-metadata">

**Author:** [@wwguo](https://discourse.mc-stan.org/u/wwguo)\
**Replies:** 2\
**Last updated:** [June 3, 2020, 8:15am UTC](https://discourse.mc-stan.org/t/the-result-of-integrate-1d-is-confusing/15391 "2020-06-03T08:15:43Z")

</div>

I use the normal\_density function provided by stan-users-guide: real normal\_density(real x, real xc, real\[\] theta, real\[\] x\_r, int\[\] x\_i) { real mu = theta\[1\]; real sigma = theta\[2\]; return 1 / (sqrt(2 \* pi()) \* s…

---

## [Potential Bug in brms bayes\_factor() function](https://discourse.mc-stan.org/t/potential-bug-in-brms-bayes-factor-function/13992)

<div class="topic-metadata">

**Author:** [@kmorehouse](https://discourse.mc-stan.org/u/kmorehouse)\
**Replies:** 3\
**Last updated:** [April 8, 2020, 6:31pm UTC](https://discourse.mc-stan.org/t/potential-bug-in-brms-bayes-factor-function/13992 "2020-04-08T18:31:24Z")

</div>

My collaborator and I have been having issues with the bayes\_factor() function. Specifically, we’ve been getting inconsistent and outlandish (either 0 or INF) BFs when we are using datasets that include more than a coupl…

---

## [RStan Always trying to download RTools when it's already installed](https://discourse.mc-stan.org/t/rstan-always-trying-to-download-rtools-when-its-already-installed/7682)

<div class="topic-metadata">

**Author:** [@Joseph\_Dean](https://discourse.mc-stan.org/u/Joseph_Dean)\
**Replies:** 17\
**Last updated:** [April 3, 2020, 10:31am UTC](https://discourse.mc-stan.org/t/rstan-always-trying-to-download-rtools-when-its-already-installed/7682 "2020-04-03T10:31:42Z")

</div>

I have RTools downloaded to my documents folder rather than directly on C due to permission issues (corporate access issues). Every time I try to run a Stan model, I get the “Install Build Tools” dialog box. How can I …

---

## [Error / bug in brms models?](https://discourse.mc-stan.org/t/error-bug-in-brms-models/6276)

<div class="topic-metadata">

**Author:** [@jonnations](https://discourse.mc-stan.org/u/jonnations)\
**Replies:** 42\
**Last updated:** [March 3, 2020, 8:52pm UTC](https://discourse.mc-stan.org/t/error-bug-in-brms-models/6276 "2020-03-03T20:52:07Z")

</div>

Hi, I am having a weird problem with brms. My models don’t seem to run, and I get the error: running command ''/Library/Frameworks/R.framework/Resources/bin/R' CMD config CXX14 2\>/dev/null' had status 72 I recently up…

---

## [Bug in brms bayes\_factor for model with me() term?](https://discourse.mc-stan.org/t/bug-in-brms-bayes-factor-for-model-with-me-term/12686)

<div class="topic-metadata">

**Author:** [@drjhw](https://discourse.mc-stan.org/u/drjhw)\
**Replies:** 5\
**Last updated:** [January 27, 2020, 6:41pm UTC](https://discourse.mc-stan.org/t/bug-in-brms-bayes-factor-for-model-with-me-term/12686 "2020-01-27T18:41:15Z")

</div>

The function bayes\_factor in brms behaves oddly when the model includes a term with measurement error - me(F,sdF1) I wish to estimate the effect of an environmental factor, F, on the numbers of people with low body weig…

---

## [Bug in rstan](https://discourse.mc-stan.org/t/bug-in-rstan/11691)

<div class="topic-metadata">

**Author:** [@andrewgelman](https://discourse.mc-stan.org/u/andrewgelman)\
**Replies:** 6\
**Last updated:** [October 31, 2019, 10:50pm UTC](https://discourse.mc-stan.org/t/bug-in-rstan/11691 "2019-10-31T22:50:33Z")

</div>

Hi all. I found a bug in rstan. When my stan code has a typo in it, stan() screws up. Instead of returning an error, it just returns a blank prompt and then puts R in a bad state where it ignores errors. See code bel…

---

## [Bug in indexed assignment](https://discourse.mc-stan.org/t/bug-in-indexed-assignment/10148)

<div class="topic-metadata">

**Author:** [@seantalts](https://discourse.mc-stan.org/u/seantalts)\
**Replies:** 0\
**Last updated:** [August 12, 2019, 5:09pm UTC](https://discourse.mc-stan.org/t/bug-in-indexed-assignment/10148 "2019-08-12T17:09:55Z")

</div>

Hey all, Over in the new compiler, we’ve discovered a bug - basically a\[:\]\[2\] and a\[:, 2\] are equivalent if they appear as the destination for an assignment, but on the right hand size the a\[:\]\[2\] is equivalent to a\[2…

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