# \#cmdstanr

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

---

## [Initialization failure in negative-binomial model with exact and right-censored likelihood contributions](https://discourse.mc-stan.org/t/initialization-failure-in-negative-binomial-model-with-exact-and-right-censored-likelihood-contributions/41644)

<div class="topic-metadata">

**Author:** [@arumadri](https://discourse.mc-stan.org/u/arumadri)\
**Replies:** 5\
**Last updated:** [October 22, 2026, 4:52pm UTC](https://discourse.mc-stan.org/t/initialization-failure-in-negative-binomial-model-with-exact-and-right-censored-likelihood-contributions/41644 "2026-10-22T16:52:52Z")

</div>

I’m trying to fit a large spatial-temporal Bayesian model with close to 1,700 areas across 10 years in Stan using a negative-binomial model with exact and right-censored likelihood contributions. Predictors include meter…

---

## [CmdStanR 1.0 release candidate is now available](https://discourse.mc-stan.org/t/cmdstanr-1-0-release-candidate-is-now-available/41668)

<div class="topic-metadata">

**Author:** [@jonah](https://discourse.mc-stan.org/u/jonah)\
**Replies:** 1\
**Last updated:** [October 16, 2026, 9:55pm UTC](https://discourse.mc-stan.org/t/cmdstanr-1-0-release-candidate-is-now-available/41668 "2026-10-16T21:55:02Z")

</div>

I’m happy to announce that a release candidate for CmdStanR 1.0 is ready and available for testing! This will be by far the biggest release since the initial release of the package. One of the main changes is to how mode…

---

## [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::…

---

## [Multiresponse brms models - chains finishing unexpectedly](https://discourse.mc-stan.org/t/multiresponse-brms-models-chains-finishing-unexpectedly/41534)

<div class="topic-metadata">

**Author:** [@Anoban](https://discourse.mc-stan.org/u/Anoban)\
**Replies:** 2\
**Last updated:** [August 21, 2026, 1:58am UTC](https://discourse.mc-stan.org/t/multiresponse-brms-models-chains-finishing-unexpectedly/41534 "2026-08-21T01:58:35Z")

</div>

Hi there! (I was redirected from github here). I’m running a set of phylogenetic and non-phylogenetic brms models on a Ubuntu 24.04.4 server with brms version 2.23.0, cmdstanr version 0.9.0 and R version 4.6.1, using cm…

---

## [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 …

---

## [EIV model of temporal trend with Berkson-like error](https://discourse.mc-stan.org/t/eiv-model-of-temporal-trend-with-berkson-like-error/41435)

<div class="topic-metadata">

**Author:** [@roberto\_r](https://discourse.mc-stan.org/u/roberto_r)\
**Replies:** 6\
**Last updated:** [August 9, 2026, 10:26am UTC](https://discourse.mc-stan.org/t/eiv-model-of-temporal-trend-with-berkson-like-error/41435 "2026-08-09T10:26:14Z")

</div>

Hello, I am trying to build an error-in-variables model in which the error is Berkson-like rather than a classical measurement error. My goal is to recover the long-term trend of a continuous variable. To begin with, I…

---

## [Diststan — distributed Stan fits across a network of computers](https://discourse.mc-stan.org/t/diststan-distributed-stan-fits-across-a-network-of-computers/41392)

<div class="topic-metadata">

**Author:** [@ssp3nc3r](https://discourse.mc-stan.org/u/ssp3nc3r)\
**Replies:** 2\
**Last updated:** [June 27, 2026, 2:10pm UTC](https://discourse.mc-stan.org/t/diststan-distributed-stan-fits-across-a-network-of-computers/41392 "2026-06-27T14:10:54Z")

</div>

Run chains for one fit across a few machines on your network — by hand? To cut the manual friction of distributing, monitoring, and collecting the draw files, I wrote myself a package and thought I’d share in case anyon…

---

## [Issue installing cmdstan](https://discourse.mc-stan.org/t/issue-installing-cmdstan/40990)

<div class="topic-metadata">

**Author:** [@mattansb](https://discourse.mc-stan.org/u/mattansb)\
**Replies:** 14\
**Last updated:** [April 1, 2026, 5:45pm UTC](https://discourse.mc-stan.org/t/issue-installing-cmdstan/40990 "2026-04-01T17:45:34Z")

</div>

I’m trying to help my student install cmdstan through cmdstanr (on Windows) but keep getting the same error: library(cmdstanr) check\_cmdstan\_toolchain() #\> The C++ toolchain required for CmdStan is setup properly! ins…

---

## [Brmspy: Python-first access to brms (cmdstanr backend, ArviZ output)](https://discourse.mc-stan.org/t/brmspy-python-first-access-to-brms-cmdstanr-backend-arviz-output/40685)

<div class="topic-metadata">

**Author:** [@Braffolk](https://discourse.mc-stan.org/u/Braffolk)\
**Replies:** 10\
**Last updated:** [March 27, 2026, 1:27pm UTC](https://discourse.mc-stan.org/t/brmspy-python-first-access-to-brms-cmdstanr-backend-arviz-output/40685 "2026-03-27T13:27:52Z")

</div>

Hi all. I wanted to share a Python interface I’ve been building for brms that may be useful for anyone who works across both R and Python environments. brmspy provides a Python-side API for fitting brms models via cmdst…

---

## [Help us test a new progress bar for sampling in CmdStanR!](https://discourse.mc-stan.org/t/help-us-test-a-new-progress-bar-for-sampling-in-cmdstanr/40946)

<div class="topic-metadata">

**Author:** [@jonah](https://discourse.mc-stan.org/u/jonah)\
**Replies:** 11\
**Last updated:** [March 3, 2026, 7:35pm UTC](https://discourse.mc-stan.org/t/help-us-test-a-new-progress-bar-for-sampling-in-cmdstanr/40946 "2026-03-03T19:35:11Z")

</div>

@josswright has implemented a progress bar for sampling in CmdStanR: It would be great to have some Stan users test it out so we can incorporate your feedback before including it in a release. The “Summary” section at…

---

## [Monte Carlo error for Pathfinder fit](https://discourse.mc-stan.org/t/monte-carlo-error-for-pathfinder-fit/40939)

<div class="topic-metadata">

**Author:** [@fweber144](https://discourse.mc-stan.org/u/fweber144)\
**Replies:** 2\
**Last updated:** [March 1, 2026, 8:53pm UTC](https://discourse.mc-stan.org/t/monte-carlo-error-for-pathfinder-fit/40939 "2026-03-01T20:53:28Z")

</div>

When fitting a model using the Pathfinder algorithm (via cmdstanr, for example), is there a recommended way to judge the Monte Carlo error (i.e., to estimate the MCSE for a specific parameter, for example)? I’ve tried to…

---

## [Hilbert-space GP: Rhat inflation and age-specific bias when moving from yearly to monthly birth data](https://discourse.mc-stan.org/t/hilbert-space-gp-rhat-inflation-and-age-specific-bias-when-moving-from-yearly-to-monthly-birth-data/40898)

<div class="topic-metadata">

**Author:** [@anthony\_462](https://discourse.mc-stan.org/u/anthony_462)\
**Replies:** 5\
**Last updated:** [February 9, 2026, 6:09pm UTC](https://discourse.mc-stan.org/t/hilbert-space-gp-rhat-inflation-and-age-specific-bias-when-moving-from-yearly-to-monthly-birth-data/40898 "2026-02-09T18:09:47Z")

</div>

Aim: I am modelling the number of births y\_{i,m,j} by year i (2000–2024), month m and mother age j (15-50). The goal is to estimate the mean number of births by age without systematic bias. The model should also capture…

---

## [Documentation bug in profiling vignette?](https://discourse.mc-stan.org/t/documentation-bug-in-profiling-vignette/40906)

<div class="topic-metadata">

**Author:** [@bmelinden](https://discourse.mc-stan.org/u/bmelinden)\
**Replies:** 3\
**Last updated:** [February 9, 2026, 6:08pm UTC](https://discourse.mc-stan.org/t/documentation-bug-in-profiling-vignette/40906 "2026-02-09T18:08:19Z")

</div>

I think I stumbled upon a typo in a vignette. Profiling Stan programs with CmdStanR • cmdstanr The original example stan code defined in section “Adding profiling statements to a Stan program” seems to change in the se…

---

## [Approximate Gaussian process: increase speed and efficiency](https://discourse.mc-stan.org/t/approximate-gaussian-process-increase-speed-and-efficiency/40851)

<div class="topic-metadata">

**Author:** [@anthony\_462](https://discourse.mc-stan.org/u/anthony_462)\
**Replies:** 5\
**Last updated:** [February 5, 2026, 9:16pm UTC](https://discourse.mc-stan.org/t/approximate-gaussian-process-increase-speed-and-efficiency/40851 "2026-02-05T21:16:28Z")

</div>

Hi all, I am looking for guidance on how to increase the speed and efficiency of a reduced-rank GP in my model. In particular, I am surprised by the number of basis functions I seem to need. Data The data consist of mo…

---

## [Using cmdstanr without returning the output to R?](https://discourse.mc-stan.org/t/using-cmdstanr-without-returning-the-output-to-r/40700)

<div class="topic-metadata">

**Author:** [@helske](https://discourse.mc-stan.org/u/helske)\
**Replies:** 15\
**Last updated:** [January 14, 2026, 7:27am UTC](https://discourse.mc-stan.org/t/using-cmdstanr-without-returning-the-output-to-r/40700 "2026-01-14T07:27:38Z")

</div>

I have a model which results in csv files with sizes of tens of GB, This is fine, expect creating the resulting object in R is slow and sometimes impossible due to the size. However, I don’t need to process all the varia…

---

## [Performing posterior predictive checks for variational inference models](https://discourse.mc-stan.org/t/performing-posterior-predictive-checks-for-variational-inference-models/40742)

<div class="topic-metadata">

**Author:** [@jr-leary7](https://discourse.mc-stan.org/u/jr-leary7)\
**Replies:** 4\
**Last updated:** [December 21, 2025, 9:26pm UTC](https://discourse.mc-stan.org/t/performing-posterior-predictive-checks-for-variational-inference-models/40742 "2025-12-21T21:26:18Z")

</div>

Hi all, Apologies in advance for the long post - feel free to jump to the Questions section at the end. Background Over the past year or so I’ve been working on developing a hierarchical approximate Gaussian process (…

---

## [Why are MAP estimates far from true value in polytomous CDM with latent-class mixture? (Beginner question)](https://discourse.mc-stan.org/t/why-are-map-estimates-far-from-true-value-in-polytomous-cdm-with-latent-class-mixture-beginner-question/40728)

<div class="topic-metadata">

**Author:** [@gleonxu](https://discourse.mc-stan.org/u/gleonxu)\
**Replies:** 3\
**Last updated:** [December 11, 2025, 4:21pm UTC](https://discourse.mc-stan.org/t/why-are-map-estimates-far-from-true-value-in-polytomous-cdm-with-latent-class-mixture-beginner-question/40728 "2025-12-11T16:21:30Z")

</div>

Hi everyone, I’m new to Stan and mixture models. I’m fitting a polytomous cognitive diagnosis model (DINA-like) where latent attribute mastery patterns are explicitly enumerated: C = 2^K and the likelihood is a mixtur…

---

## [CmdStan, CmdStanR, CmdStanPy workflow resulting in errors with \`as.shinystan\` function](https://discourse.mc-stan.org/t/cmdstan-cmdstanr-cmdstanpy-workflow-resulting-in-errors-with-as-shinystan-function/40672)

<div class="topic-metadata">

**Author:** [@danni\_storm](https://discourse.mc-stan.org/u/danni_storm)\
**Replies:** 6\
**Last updated:** [December 11, 2025, 2:43pm UTC](https://discourse.mc-stan.org/t/cmdstan-cmdstanr-cmdstanpy-workflow-resulting-in-errors-with-as-shinystan-function/40672 "2025-12-11T14:43:05Z")

</div>

My model successfully runs and produces CSV files. However, when trying to use R and ShinyStan, I am unable to get ShinyStan to accept my model files using CmdStanR. I have been digging into the documentation and it look…

---

## [Parameters that depend on missing values](https://discourse.mc-stan.org/t/parameters-that-depend-on-missing-values/40674)

<div class="topic-metadata">

**Author:** [@Saul\_Ortiz](https://discourse.mc-stan.org/u/Saul_Ortiz)\
**Replies:** 2\
**Last updated:** [December 1, 2025, 10:12pm UTC](https://discourse.mc-stan.org/t/parameters-that-depend-on-missing-values/40674 "2025-12-01T22:12:25Z")

</div>

I have this simple regression model y\_{ij} = \\mu\_{i} + x\_{ij}^{T}\\beta + e\_{ij}, where e\_{ij} \\sim N(0, \\sigma^2\_{i}) and e\_{ij}, e\_{ij'} are independent. i indexes ‘regions’: i=1, 2, \\ldots, K and j indexes instances …

---

## [Limits to JSON conversion for Large Data (R character strings are limited to 2^31-1 bytes)](https://discourse.mc-stan.org/t/limits-to-json-conversion-for-large-data-r-character-strings-are-limited-to-2-31-1-bytes/24290)

<div class="topic-metadata">

**Author:** [@klattery](https://discourse.mc-stan.org/u/klattery)\
**Replies:** 10\
**Last updated:** [November 19, 2025, 1:32pm UTC](https://discourse.mc-stan.org/t/limits-to-json-conversion-for-large-data-r-character-strings-are-limited-to-2-31-1-bytes/24290 "2025-11-19T13:32:16Z")

</div>

My R list has several data objects, totaling 7GB in R. The main list object is the independent data matrix of size 5 million x 157. The following error is given when I try to sample in CmdStanR: Error in collapse(tmp, i…

---

## [Optimize (and thus Laplace) yields biased estimates](https://discourse.mc-stan.org/t/optimize-and-thus-laplace-yields-biased-estimates/40650)

<div class="topic-metadata">

**Author:** [@trinhdhk](https://discourse.mc-stan.org/u/trinhdhk)\
**Replies:** 4\
**Last updated:** [November 18, 2025, 6:46pm UTC](https://discourse.mc-stan.org/t/optimize-and-thus-laplace-yields-biased-estimates/40650 "2025-11-18T18:46:58Z")

</div>

Stan optimizing seems to yield biased MAP estimates in weighted model, especially for scale parameters. Attached is the cmdstanr model (modified from brms) together with the corresponding standata. stan-opt.Rdata (599.…

---

## [Better initialization information on cmdstanR (cmdstan?)](https://discourse.mc-stan.org/t/better-initialization-information-on-cmdstanr-cmdstan/40556)

<div class="topic-metadata">

**Author:** [@trinhdhk](https://discourse.mc-stan.org/u/trinhdhk)\
**Replies:** 3\
**Last updated:** [October 24, 2025, 12:07pm UTC](https://discourse.mc-stan.org/t/better-initialization-information-on-cmdstanr-cmdstan/40556 "2025-10-24T12:07:32Z")

</div>

In RStan, information about leapfrog time and, more importantly, initialization issues such as dimensional mismatch in data input are well reported. This is not the case in cmdstanR where the program simply crashes sile…

---

## [Cmdstanr slow to return results and influenced by internet connection](https://discourse.mc-stan.org/t/cmdstanr-slow-to-return-results-and-influenced-by-internet-connection/40331)

<div class="topic-metadata">

**Author:** [@Cataman](https://discourse.mc-stan.org/u/Cataman)\
**Replies:** 5\
**Last updated:** [September 18, 2025, 6:05pm UTC](https://discourse.mc-stan.org/t/cmdstanr-slow-to-return-results-and-influenced-by-internet-connection/40331 "2025-09-18T18:05:04Z")

</div>

I am running the following code and experiencing a long delay after sampling completes. The sampling complete in less than 2 seconds but R does not complete for many seconds after that. The amount of time that it takes t…

---

## [All chains finished unexpectedly!](https://discourse.mc-stan.org/t/all-chains-finished-unexpectedly/31836)

<div class="topic-metadata">

**Author:** [@apteroti](https://discourse.mc-stan.org/u/apteroti)\
**Replies:** 9\
**Last updated:** [September 1, 2025, 5:39pm UTC](https://discourse.mc-stan.org/t/all-chains-finished-unexpectedly/31836 "2025-09-01T17:39:29Z")

</div>

I’m using CmdStanr to do my modelling. Inside my stan file (functions block), I have a custom function which I call inside the transformed parameters block to generate a parameter. Normally the sampling procedure of my …

---

## [Help needed with CmdStanR parallel chains](https://discourse.mc-stan.org/t/help-needed-with-cmdstanr-parallel-chains/40307)

<div class="topic-metadata">

**Author:** [@dkbishop](https://discourse.mc-stan.org/u/dkbishop)\
**Replies:** 1\
**Last updated:** [August 31, 2025, 5:13pm UTC](https://discourse.mc-stan.org/t/help-needed-with-cmdstanr-parallel-chains/40307 "2025-08-31T17:13:04Z")

</div>

Hi all, I hope you can help me with how parallel chains works in CmdStanR. I’m getting what I feel are counterintuitive results but it’s because I don’t understand what is happening. I’m running a very basic Bayesian li…

---

## [Saving log-likelihood with parallelized implementation](https://discourse.mc-stan.org/t/saving-log-likelihood-with-parallelized-implementation/40263)

<div class="topic-metadata">

**Author:** [@Loni92](https://discourse.mc-stan.org/u/Loni92)\
**Replies:** 1\
**Last updated:** [August 22, 2025, 6:47pm UTC](https://discourse.mc-stan.org/t/saving-log-likelihood-with-parallelized-implementation/40263 "2025-08-22T18:47:44Z")

</div>

Hi all, I am trying to implement a parallelized version of my model using the reduce\_sum function. I am wondering if it is somehow possible to still save the log-likelihood of each data point for model comparison later …

---

## [Extracting the log posterior probability of a cmdstan model as function](https://discourse.mc-stan.org/t/extracting-the-log-posterior-probability-of-a-cmdstan-model-as-function/40251)

<div class="topic-metadata">

**Author:** [@kokorap27](https://discourse.mc-stan.org/u/kokorap27)\
**Replies:** 7\
**Last updated:** [August 21, 2025, 6:41pm UTC](https://discourse.mc-stan.org/t/extracting-the-log-posterior-probability-of-a-cmdstan-model-as-function/40251 "2025-08-21T18:41:21Z")

</div>

Hello Stan Community! Context: I’d like to fit a Bayesian hierarchical model with more than one set of spatio-temporal effects and unobserved/latent variables by using cmdstanr. In order to do so, I need to set initial …

---

## [How to improve model sampling speed when applied to high-dimension data](https://discourse.mc-stan.org/t/how-to-improve-model-sampling-speed-when-applied-to-high-dimension-data/40005)

<div class="topic-metadata">

**Author:** [@Vicky547](https://discourse.mc-stan.org/u/Vicky547)\
**Replies:** 8\
**Last updated:** [August 21, 2025, 6:12pm UTC](https://discourse.mc-stan.org/t/how-to-improve-model-sampling-speed-when-applied-to-high-dimension-data/40005 "2025-08-21T18:12:31Z")

</div>

Hello! I am new to stan and it’s my first time posting here. I am analyzing data from an epidemiology study and use catalytic epidemiology model. My input is a 4 dimension matrix of infected cases, specific to age, munic…

---

## [Torsten + Friberg–Karlsson model: ODE solver crashes during warmup](https://discourse.mc-stan.org/t/torsten-friberg-karlsson-model-ode-solver-crashes-during-warmup/40098)

<div class="topic-metadata">

**Author:** [@gokhale](https://discourse.mc-stan.org/u/gokhale)\
**Replies:** 3\
**Last updated:** [August 21, 2025, 4:15pm UTC](https://discourse.mc-stan.org/t/torsten-friberg-karlsson-model-ode-solver-crashes-during-warmup/40098 "2025-08-21T16:15:08Z")

</div>

Howdy! I am quite excited to start my journey into bayesian PKPD! I’m trying to reproduce the Friberg–Karlsson semi-mechanistic neutropenia model in Stan using Torsten’s pmx\_solve\_group\_rk45 as documented in this wonde…

---

## [Indexing issue while fitting data to an ODE model with a dynamical parameter](https://discourse.mc-stan.org/t/indexing-issue-while-fitting-data-to-an-ode-model-with-a-dynamical-parameter/40106)

<div class="topic-metadata">

**Author:** [@peter-kamal](https://discourse.mc-stan.org/u/peter-kamal)\
**Replies:** 2\
**Last updated:** [August 8, 2025, 9:30am UTC](https://discourse.mc-stan.org/t/indexing-issue-while-fitting-data-to-an-ode-model-with-a-dynamical-parameter/40106 "2025-08-08T09:30:40Z")

</div>

Please share your Stan program and accompanying data if possible. Hi, I have data from biological microcosms (3 replicates of population growth of unicellular organisms). They follow some sort of boom-bust dynamics, w…

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