# Interfaces

**URL:** https://discourse.mc-stan.org/c/interfaces/5.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)

---

## [About the Interfaces category](https://discourse.mc-stan.org/t/about-the-interfaces-category/16)

<div class="topic-metadata">

**Author:** [@betanalpha](https://discourse.mc-stan.org/u/betanalpha)\
**Replies:** 0

</div>

This category is for questions regarding the installation and use of the Stan interfaces.

---

## [Cmdstanr g++ permission denied](https://discourse.mc-stan.org/t/cmdstanr-g-permission-denied/41805)

<div class="topic-metadata">

**Author:** [@RElahi](https://discourse.mc-stan.org/u/RElahi)\
**Replies:** 12\
**Last updated:** [November 6, 2026, 6:36pm UTC](https://discourse.mc-stan.org/t/cmdstanr-g-permission-denied/41805 "2026-11-06T18:36:35Z")

</div>

My Windows machine recently updated its OS, which seems to have messed up a lot of my R packages. I was able to fix all of them, but now I cannot compile brms models using cmdstanr. I tried reinstalling rstan, cmdstanr, …

---

## [How can I use the same function call to sample from posterior when data exists and only sample from prior when not?](https://discourse.mc-stan.org/t/how-can-i-use-the-same-function-call-to-sample-from-posterior-when-data-exists-and-only-sample-from-prior-when-not/41685)

<div class="topic-metadata">

**Author:** [@ischmidt20](https://discourse.mc-stan.org/u/ischmidt20)\
**Replies:** 11\
**Last updated:** [November 5, 2026, 7:27pm UTC](https://discourse.mc-stan.org/t/how-can-i-use-the-same-function-call-to-sample-from-posterior-when-data-exists-and-only-sample-from-prior-when-not/41685 "2026-11-05T19:27:37Z")

</div>

I have a brms model where sometimes there is no data, in which case I want brms to sample from the prior just as it normally would the posterior. Previously, I had code like this: cond \<- ... if (sum(cond) == 0) { s…

---

## [Should I change intercept priors when using sum coding?](https://discourse.mc-stan.org/t/should-i-change-intercept-priors-when-using-sum-coding/41745)

<div class="topic-metadata">

**Author:** [@bertiebear](https://discourse.mc-stan.org/u/bertiebear)\
**Replies:** 6\
**Last updated:** [November 4, 2026, 8:37pm UTC](https://discourse.mc-stan.org/t/should-i-change-intercept-priors-when-using-sum-coding/41745 "2026-11-04T20:37:33Z")

</div>

Hello everyone, I’ve been learning Bayesian statistics with brms for a while now, and I’ve used Bayesian linear regression in some cases. My programme (Master’s in Public Health) doesn’t deal with Bayesian statistics at …

---

## [CmdStanPy 1.3.2 Released](https://discourse.mc-stan.org/t/cmdstanpy-1-3-2-released/41748)

<div class="topic-metadata">

**Author:** [@WardBrian](https://discourse.mc-stan.org/u/WardBrian)\
**Replies:** 0\
**Last updated:** [November 3, 2026, 6:58pm UTC](https://discourse.mc-stan.org/t/cmdstanpy-1-3-2-released/41748 "2026-11-03T18:58:27Z")

</div>

https://pypi.org/project/cmdstanpy/1.3.2/ This patch release primarily exists for Windows users, as the install\_cxx\_toolchain function will not work on the previous release any longer due to a URL change by CRAN. The o…

---

## [Ggdist::marginalize\_lkjcorr() not working as intended](https://discourse.mc-stan.org/t/ggdist-marginalize-lkjcorr-not-working-as-intended/41658)

<div class="topic-metadata">

**Author:** [@blokeman](https://discourse.mc-stan.org/u/blokeman)\
**Replies:** 4\
**Last updated:** [October 20, 2026, 9:30pm UTC](https://discourse.mc-stan.org/t/ggdist-marginalize-lkjcorr-not-working-as-intended/41658 "2026-10-20T21:30:20Z")

</div>

I can’t visualize the lkj priors of my correlation parameters because I can’t find how to convert the lkj\_corr\_cholesky(eta) priors into .dist objects that stat\_slabinterval() would understand. The marginalize\_lkjcorr() …

---

## [Error in sink(type = "output") : invalid connection](https://discourse.mc-stan.org/t/error-in-sink-type-output-invalid-connection/41634)

<div class="topic-metadata">

**Author:** [@kieran.mcadams](https://discourse.mc-stan.org/u/kieran.mcadams)\
**Replies:** 12\
**Last updated:** [October 12, 2026, 6:02am UTC](https://discourse.mc-stan.org/t/error-in-sink-type-output-invalid-connection/41634 "2026-10-12T06:02:19Z")

</div>

Hello, I’m new to running stan code and seem to be having issues having my model run in R. Versions: R 4.6.0 RTools 4.5 rstan 2.32.7 StanHeaders 2.39.1 Rcpp 1.1.2 I’ve tried running a simple model to test whether…

---

## [How to calculate phylogenetic signal for a varying slopes model?](https://discourse.mc-stan.org/t/how-to-calculate-phylogenetic-signal-for-a-varying-slopes-model/32683)

<div class="topic-metadata">

**Author:** [@daSilva5](https://discourse.mc-stan.org/u/daSilva5)\
**Replies:** 3\
**Last updated:** [October 11, 2026, 1:15am UTC](https://discourse.mc-stan.org/t/how-to-calculate-phylogenetic-signal-for-a-varying-slopes-model/32683 "2026-10-11T01:15:34Z")

</div>

Short summary of the problem I would like to know how to calculate the phylogenetic signal for models with varying slopes and intercepts. Following from https://cran.r-project.org/web/packages/brms/vignettes/brms\_phylog…

---

## [Sharing a function to switch between interfaces to stan in R](https://discourse.mc-stan.org/t/sharing-a-function-to-switch-between-interfaces-to-stan-in-r/41638)

<div class="topic-metadata">

**Author:** [@ChrisWymant](https://discourse.mc-stan.org/u/ChrisWymant)\
**Replies:** 8\
**Last updated:** [October 7, 2026, 9:44pm UTC](https://discourse.mc-stan.org/t/sharing-a-function-to-switch-between-interfaces-to-stan-in-r/41638 "2026-10-07T21:44:26Z")

</div>

A comment not a question. In case useful to others, here’s an R function to which you give a path to Stan code, the input it expects, plus a choice of rstan, cmdstanr or cmdstan, and it will compile & run the code and re…

---

## [Issues with tuples in cmdstanr](https://discourse.mc-stan.org/t/issues-with-tuples-in-cmdstanr/34626)

<div class="topic-metadata">

**Author:** [@Christopher-Peterson](https://discourse.mc-stan.org/u/Christopher-Peterson)\
**Replies:** 8\
**Last updated:** [September 29, 2026, 7:03pm UTC](https://discourse.mc-stan.org/t/issues-with-tuples-in-cmdstanr/34626 "2026-09-29T19:03:36Z")

</div>

I’ve noticed a few issues with using tuple types in cmdstanr; specifically, there are parts of cmdstanr that don’t seem to understand tuples and can trigger cryptic errors. Passing tuple data to cmdstan The cmdstanr::…

---

## [Help testing brms pr for sum-to-zero and partial centering](https://discourse.mc-stan.org/t/help-testing-brms-pr-for-sum-to-zero-and-partial-centering/41542)

<div class="topic-metadata">

**Author:** [@spinkney](https://discourse.mc-stan.org/u/spinkney)\
**Replies:** 43\
**Last updated:** [September 18, 2026, 9:39am UTC](https://discourse.mc-stan.org/t/help-testing-brms-pr-for-sum-to-zero-and-partial-centering/41542 "2026-09-18T09:39:05Z")

</div>

Hi brms users, I’m hoping to get eyes on this pr Add fast sum-to-zero parameterizations for group effects by spinkney · Pull Request #1919 · paul-buerkner/brms · GitHub Warnings, it is large and it is AI generated becau…

---

## [RStan compilation error with R 4.6.1, Rtools45 and rstan 2.39](https://discourse.mc-stan.org/t/rstan-compilation-error-with-r-4-6-1-rtools45-and-rstan-2-39/41589)

<div class="topic-metadata">

**Author:** [@Marta](https://discourse.mc-stan.org/u/Marta)\
**Replies:** 4\
**Last updated:** [September 12, 2026, 9:07am UTC](https://discourse.mc-stan.org/t/rstan-compilation-error-with-r-4-6-1-rtools45-and-rstan-2-39/41589 "2026-09-12T09:07:05Z")

</div>

Hello, I am having a compilation problem with RStan on Windows and would appreciate your help identifying the cause. My current setup is: Windows 10 Pro R 4.6.1 (2026-06-24 ucrt) Rtools45 GCC 14.3.0 rsta…

---

## [Understanding sample\_new\_levels = "uncertainty", "gaussian", and "old\_levels"](https://discourse.mc-stan.org/t/understanding-sample-new-levels-uncertainty-gaussian-and-old-levels/7828)

<div class="topic-metadata">

**Author:** [@AntonioV](https://discourse.mc-stan.org/u/AntonioV)\
**Replies:** 19\
**Last updated:** [September 7, 2026, 12:27pm UTC](https://discourse.mc-stan.org/t/understanding-sample-new-levels-uncertainty-gaussian-and-old-levels/7828 "2026-09-07T12:27:17Z")

</div>

The documentation for brms::extract\_draws() says this about the sample\_new\_levels option: Indicates how to sample new levels for grouping factors specified in re\_formula. This argument is only relevant if newdata is pr…

---

## [Shape constrained (e.g., monotonic) smooths in brms](https://discourse.mc-stan.org/t/shape-constrained-e-g-monotonic-smooths-in-brms/7128)

<div class="topic-metadata">

**Author:** [@tiflo](https://discourse.mc-stan.org/u/tiflo)\
**Replies:** 17\
**Last updated:** [September 4, 2026, 8:56am UTC](https://discourse.mc-stan.org/t/shape-constrained-e-g-monotonic-smooths-in-brms/7128 "2026-09-04T08:56:02Z")

</div>

I was delighted to see that brms allows shape constrained smooths as from the scam package as part of its formula syntax. However, the post-processing such as marginal\_effects() does not seem to work. I found this old po…

---

## [Saving and sharing an rstan model fit](https://discourse.mc-stan.org/t/saving-and-sharing-an-rstan-model-fit/1059)

<div class="topic-metadata">

**Author:** [@jeremy.koster](https://discourse.mc-stan.org/u/jeremy.koster)\
**Replies:** 5\
**Last updated:** [August 24, 2026, 7:01am UTC](https://discourse.mc-stan.org/t/saving-and-sharing-an-rstan-model-fit/1059 "2026-08-24T07:01:57Z")

</div>

This might be a basic question, but a search on relevant terms did not reveal a discussion. Apologies if I missed anything. I have estimated a model with rstan, and I would like to save the model fit object to send to …

---

## [Unusually slow GPU (OpenCL) vs CPU sampling times in blavaan/cmdstanr on MareNostrum 5](https://discourse.mc-stan.org/t/unusually-slow-gpu-opencl-vs-cpu-sampling-times-in-blavaan-cmdstanr-on-marenostrum-5/41520)

<div class="topic-metadata">

**Author:** [@Sinval](https://discourse.mc-stan.org/u/Sinval)\
**Replies:** 2\
**Last updated:** [August 17, 2026, 11:57am UTC](https://discourse.mc-stan.org/t/unusually-slow-gpu-opencl-vs-cpu-sampling-times-in-blavaan-cmdstanr-on-marenostrum-5/41520 "2026-08-17T11:57:10Z")

</div>

I am encountering a severe performance degradation when using the GPU backend compared to the CPU in Bayesian SEM simulations via blavaan and cmdstanr. The GPU OpenCL sampling times are significantly slower than the CPU …

---

## [Posterior distribution and heterogeneity in Bayesian three-level meta-analysis with brms](https://discourse.mc-stan.org/t/posterior-distribution-and-heterogeneity-in-bayesian-three-level-meta-analysis-with-brms/41451)

<div class="topic-metadata">

**Author:** [@Yuanyuan](https://discourse.mc-stan.org/u/Yuanyuan)\
**Replies:** 0\
**Last updated:** [July 21, 2026, 10:29am UTC](https://discourse.mc-stan.org/t/posterior-distribution-and-heterogeneity-in-bayesian-three-level-meta-analysis-with-brms/41451 "2026-07-21T10:29:36Z")

</div>

Hi, As a beginner, I am trying to do a Bayesian three-level meta-analysis with brms. Following the https://doing-meta.guide/bayesian-ma , here is the code for my main model. #Main model main.model \<- brm(yi|se(seTE)~ …

---

## [Lognormal family in brms](https://discourse.mc-stan.org/t/lognormal-family-in-brms/41429)

<div class="topic-metadata">

**Author:** [@Hunter24](https://discourse.mc-stan.org/u/Hunter24)\
**Replies:** 4\
**Last updated:** [July 16, 2026, 6:25pm UTC](https://discourse.mc-stan.org/t/lognormal-family-in-brms/41429 "2026-07-16T18:25:17Z")

</div>

I simulated lognormal data, where the variation on the log scale is constant which I believe represents the lognormal family assumptions in brms. When I simulated this data I recovered all parameters almost exactly, but…

---

## ["get\_prior() shows only one group random intercept prior when using gr(by = ...), shouldn't there be two as this model assumes groups being drawn from separate distributions?"](https://discourse.mc-stan.org/t/get-prior-shows-only-one-group-random-intercept-prior-when-using-gr-by-shouldnt-there-be-two-as-this-model-assumes-groups-being-drawn-from-separate-distributions/41428)

<div class="topic-metadata">

**Author:** [@hunter\_warick](https://discourse.mc-stan.org/u/hunter_warick)\
**Replies:** 0\
**Last updated:** [July 8, 2026, 7:53am UTC](https://discourse.mc-stan.org/t/get-prior-shows-only-one-group-random-intercept-prior-when-using-gr-by-shouldnt-there-be-two-as-this-model-assumes-groups-being-drawn-from-separate-distributions/41428 "2026-07-08T07:53:22Z")

</div>

Short summary of the problem brm.formula.1 \<- bf( y ~ 0 + group+ # Group-specific independent random intercepts (1 | gr(ID, by = group)), sigma ~ 0 + group ) prior\_1 \<- # coefficients prior(normal(l…

---

## [New loo package CRAN release v.2.10.0](https://discourse.mc-stan.org/t/new-loo-package-cran-release-v-2-10-0/41400)

<div class="topic-metadata">

**Author:** [@avehtari](https://discourse.mc-stan.org/u/avehtari)\
**Replies:** 3\
**Last updated:** [June 30, 2026, 8:13pm UTC](https://discourse.mc-stan.org/t/new-loo-package-cran-release-v-2-10-0/41400 "2026-06-30T20:13:35Z")

</div>

There is a new loo package CRAN release v2.10.0 with the most important new feature being new loo\_compare() output with columns p\_worse, diag\_diff and diag\_elpd, based on paper “Uncertainty in Bayesian leave-one-out cro…

---

## [Cannot install Cmdstan due to Windows 11 permissions issue](https://discourse.mc-stan.org/t/cannot-install-cmdstan-due-to-windows-11-permissions-issue/41382)

<div class="topic-metadata">

**Author:** [@qdread](https://discourse.mc-stan.org/u/qdread)\
**Replies:** 1\
**Last updated:** [June 26, 2026, 6:33pm UTC](https://discourse.mc-stan.org/t/cannot-install-cmdstan-due-to-windows-11-permissions-issue/41382 "2026-06-26T18:33:35Z")

</div>

Hello, I am a Stan user who has to use a work PC that is configured with various restrictions. I have had issues installing Cmdstan in the past ( Windows 11 cmdstan installation issue: Architecture not detected, related …

---

## [Why does changing the reference level wildly change the predicted probabilities?](https://discourse.mc-stan.org/t/why-does-changing-the-reference-level-wildly-change-the-predicted-probabilities/41399)

<div class="topic-metadata">

**Author:** [@FeliOtte](https://discourse.mc-stan.org/u/FeliOtte)\
**Replies:** 1\
**Last updated:** [June 26, 2026, 2:21pm UTC](https://discourse.mc-stan.org/t/why-does-changing-the-reference-level-wildly-change-the-predicted-probabilities/41399 "2026-06-26T14:21:31Z")

</div>

Hello everyone, I’m having some modelling issues and I’m hoping the answer to the question above might help. I am running a multinomial/categorical model in brms and am getting results that do not make sense for my data…

---

## [Race conditions between independent cmdstan model runs](https://discourse.mc-stan.org/t/race-conditions-between-independent-cmdstan-model-runs/30918)

<div class="topic-metadata">

**Author:** [@alison](https://discourse.mc-stan.org/u/alison)\
**Replies:** 8\
**Last updated:** [June 25, 2026, 4:47pm UTC](https://discourse.mc-stan.org/t/race-conditions-between-independent-cmdstan-model-runs/30918 "2026-06-25T16:47:34Z")

</div>

Dear all, I am experiencing what looks a lot to me like some kind of race condition / interaction between independent cmdstan model runs (via cmdstanr) when fitting several models on an HPC cluster. The story is as foll…

---

## [Assessing influence of population-level predictors on one specific trial](https://discourse.mc-stan.org/t/assessing-influence-of-population-level-predictors-on-one-specific-trial/41396)

<div class="topic-metadata">

**Author:** [@IreneSophia](https://discourse.mc-stan.org/u/IreneSophia)\
**Replies:** 1\
**Last updated:** [June 25, 2026, 9:00am UTC](https://discourse.mc-stan.org/t/assessing-influence-of-population-level-predictors-on-one-specific-trial/41396 "2026-06-25T09:00:54Z")

</div>

I have an experimental design with one between-subjects factor (gender, 2 levels) and one within-subjects factor (cond, 2 levels). Each subject encounters multiple trials. The data is ordinal and I am using brms to const…

---

## [Compile Stan model in Shiny App?](https://discourse.mc-stan.org/t/compile-stan-model-in-shiny-app/10022)

<div class="topic-metadata">

**Author:** [@winterstat](https://discourse.mc-stan.org/u/winterstat)\
**Replies:** 22\
**Last updated:** [June 23, 2026, 11:51pm UTC](https://discourse.mc-stan.org/t/compile-stan-model-in-shiny-app/10022 "2026-06-23T23:51:59Z")

</div>

Hello, I hope this is the place to ask this. Let me know if I need to go elsewhere! I’m trying to run rstan in a shiny app I’m creating. It runs fine locally, but then when I deploy it to shinyapps.io, I seem unable to …

---

## [Understanding the Likelihood Model for the Cox Family in brms](https://discourse.mc-stan.org/t/understanding-the-likelihood-model-for-the-cox-family-in-brms/40622)

<div class="topic-metadata">

**Author:** [@kaybenleroll](https://discourse.mc-stan.org/u/kaybenleroll)\
**Replies:** 5\
**Last updated:** [June 16, 2026, 8:50pm UTC](https://discourse.mc-stan.org/t/understanding-the-likelihood-model-for-the-cox-family-in-brms/40622 "2026-06-16T20:50:28Z")

</div>

I am trying to understand the basic approach of the cox() family in brms. My understanding was that the idea is to model the baseline rate as a spline using the spline2 package, and then the covariates are proportional h…

---

## [PyStan and PyCharm](https://discourse.mc-stan.org/t/pystan-and-pycharm/6487)

<div class="topic-metadata">

**Author:** [@DjentMachine](https://discourse.mc-stan.org/u/DjentMachine)\
**Replies:** 21\
**Last updated:** [May 31, 2026, 9:47pm UTC](https://discourse.mc-stan.org/t/pystan-and-pycharm/6487 "2026-05-31T21:47:09Z")

</div>

Hello all, I have recently trying to use PyStan in Windows and found out it’s installation is more difficult than I thought. I normally use PyCharm as my IDE and was hopping to use PyStan with it. However, most advice I…

---

## [Calculate indirect effects for a longitudinal Gaussian Process mediation model](https://discourse.mc-stan.org/t/calculate-indirect-effects-for-a-longitudinal-gaussian-process-mediation-model/41294)

<div class="topic-metadata">

**Author:** [@drnight](https://discourse.mc-stan.org/u/drnight)\
**Replies:** 1\
**Last updated:** [May 25, 2026, 12:24pm UTC](https://discourse.mc-stan.org/t/calculate-indirect-effects-for-a-longitudinal-gaussian-process-mediation-model/41294 "2026-05-25T12:24:09Z")

</div>

Hello, I am running a longitudinal mediation model with both the independent and the mediatior variables being time-varying (for 6 time points), using Gaussian Process in brms. Would be grateful if anyone could help me…

---

## [Rstan process on remote desktop stops when I'm disconnected](https://discourse.mc-stan.org/t/rstan-process-on-remote-desktop-stops-when-im-disconnected/41215)

<div class="topic-metadata">

**Author:** [@bugay-yildirim](https://discourse.mc-stan.org/u/bugay-yildirim)\
**Replies:** 6\
**Last updated:** [May 20, 2026, 7:24am UTC](https://discourse.mc-stan.org/t/rstan-process-on-remote-desktop-stops-when-im-disconnected/41215 "2026-05-20T07:24:22Z")

</div>

Hello everyone, I am running a model using rstan in RStudio on a remote Windows laptop that is connected to my university’s server. I access it from my local computer using Windows Remote Desktop Connection (RDP) over m…

---

## [Longitudinal Mediation with only two time points](https://discourse.mc-stan.org/t/longitudinal-mediation-with-only-two-time-points/41239)

<div class="topic-metadata">

**Author:** [@drnight](https://discourse.mc-stan.org/u/drnight)\
**Replies:** 0\
**Last updated:** [May 15, 2026, 9:01pm UTC](https://discourse.mc-stan.org/t/longitudinal-mediation-with-only-two-time-points/41239 "2026-05-15T21:01:07Z")

</div>

I am doing longitudinal mediation analysis with brms. Previous suggestions include the use of splines and Gaussian process. However, because I’m only considering two time points (baseline and end-of-treatment), I am not …

[Next page](https://discourse.mc-stan.org/c/interfaces/5.md?page=1)
