# \#cmdstan

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

---

## [Vector-valued functions with manual gradients in external C++](https://discourse.mc-stan.org/t/vector-valued-functions-with-manual-gradients-in-external-c/32297)

<div class="topic-metadata">

**Author:** [@alphillips](https://discourse.mc-stan.org/u/alphillips)\
**Replies:** 20\
**Last updated:** [June 15, 2026, 7:36am UTC](https://discourse.mc-stan.org/t/vector-valued-functions-with-manual-gradients-in-external-c/32297 "2026-06-15T07:36:11Z")

</div>

Hi, I’m trying to develop an ODE model which will eventually use values from an external C++ library to inform the derivatives (and gradients of this function). Hence, I’ve started by writing a very simple ODE model wit…

---

## [Missing output variable path\_\_ with brms and pathfinder algorithm](https://discourse.mc-stan.org/t/missing-output-variable-path-with-brms-and-pathfinder-algorithm/41099)

<div class="topic-metadata">

**Author:** [@bmelinden](https://discourse.mc-stan.org/u/bmelinden)\
**Replies:** 2\
**Last updated:** [May 3, 2026, 9:11pm UTC](https://discourse.mc-stan.org/t/missing-output-variable-path-with-brms-and-pathfinder-algorithm/41099 "2026-05-03T21:11:54Z")

</div>

I have tried to experiment with the pathfinder algorithm with brms (2.23.0) and the cmdstan (2.38.0) backend, and run into Error: Can’t find the following variable(s) in the output: path\_\_ Here is a minimalist example …

---

## [Cmdstan installation fails on linux - issue with tbb?](https://discourse.mc-stan.org/t/cmdstan-installation-fails-on-linux-issue-with-tbb/31125)

<div class="topic-metadata">

**Author:** [@Unlearned5341](https://discourse.mc-stan.org/u/Unlearned5341)\
**Replies:** 4\
**Last updated:** [April 2, 2026, 10:43am UTC](https://discourse.mc-stan.org/t/cmdstan-installation-fails-on-linux-issue-with-tbb/31125 "2026-04-02T10:43:28Z")

</div>

I wish my first post would not be about an installation issue… but here I am! Yesterday, I upgraded my linux system from Fedora 37 to Fedora 38 and noticed I could not compile Stan models with cmdstanr anymore. I have tr…

---

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

---

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

---

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

---

## [\[Publication\] Computational characterization of metacognitive ability in subjective decision-making](https://discourse.mc-stan.org/t/publication-computational-characterization-of-metacognitive-ability-in-subjective-decision-making/39596)

<div class="topic-metadata">

**Author:** [@Corey.Plate](https://discourse.mc-stan.org/u/Corey.Plate)\
**Replies:** 2\
**Last updated:** [June 4, 2025, 10:50pm UTC](https://discourse.mc-stan.org/t/publication-computational-characterization-of-metacognitive-ability-in-subjective-decision-making/39596 "2025-06-04T22:50:07Z")

</div>

Hello all, I am very excited to announce our bioRxiv preprint, “Computational characterization of metacognitive ability in subjective decision-making”! You can find the publication here: https://www.biorxiv.org/content…

---

## [Packaging python project with cmdstan as dependency](https://discourse.mc-stan.org/t/packaging-python-project-with-cmdstan-as-dependency/39599)

<div class="topic-metadata">

**Author:** [@Benjamin\_Kambs](https://discourse.mc-stan.org/u/Benjamin_Kambs)\
**Replies:** 1\
**Last updated:** [May 30, 2025, 1:20am UTC](https://discourse.mc-stan.org/t/packaging-python-project-with-cmdstan-as-dependency/39599 "2025-05-30T01:20:44Z")

</div>

Hi everyone, I am currently trying to figure out the dos and don’ts of building and publishing python packages. It’s all new and cryptic to me. My package uses cmdstanpy and therefore has cmdstan as dependency. I set u…

---

## [Cmdstan won't compile if there is a model.r file present](https://discourse.mc-stan.org/t/cmdstan-wont-compile-if-there-is-a-model-r-file-present/39428)

<div class="topic-metadata">

**Author:** [@tpapp](https://discourse.mc-stan.org/u/tpapp)\
**Replies:** 9\
**Last updated:** [May 16, 2025, 12:59pm UTC](https://discourse.mc-stan.org/t/cmdstan-wont-compile-if-there-is-a-model-r-file-present/39428 "2025-05-16T12:59:54Z")

</div>

(I am asking here before opening an issue in case it is something trivial) Using cmdstan master (e45ceca604c0af), the makefile does not work when there is an .r file present with the same name as the .stan file. Instead…

---

## [What is the difference between RStan, cmdstanr and bridgestan?](https://discourse.mc-stan.org/t/what-is-the-difference-between-rstan-cmdstanr-and-bridgestan/39226)

<div class="topic-metadata">

**Author:** [@emstruong](https://discourse.mc-stan.org/u/emstruong)\
**Replies:** 6\
**Last updated:** [April 13, 2025, 3:31pm UTC](https://discourse.mc-stan.org/t/what-is-the-difference-between-rstan-cmdstanr-and-bridgestan/39226 "2025-04-13T15:31:35Z")

</div>

Hi, I develop R packages on the side and I’ve been trying to understand the differences between RStan, cmdstanr/cmdstan and bridgestan. I’m trying to figure out what use-cases each package is best suited for and would a…

---

## [If you use CmdStan on non-x86, non-arm64 Linux, speak up here!](https://discourse.mc-stan.org/t/if-you-use-cmdstan-on-non-x86-non-arm64-linux-speak-up-here/37655)

<div class="topic-metadata">

**Author:** [@WardBrian](https://discourse.mc-stan.org/u/WardBrian)\
**Replies:** 4\
**Last updated:** [March 17, 2025, 4:43pm UTC](https://discourse.mc-stan.org/t/if-you-use-cmdstan-on-non-x86-non-arm64-linux-speak-up-here/37655 "2025-03-17T16:43:29Z")

</div>

Starting with Stan 2.28 in 2021, we’ve been producing CmdStan tarballs for the following “non-standard” platforms: linux-armel linux-armhf linux-ppc64el linux-mips64el linux-s390x The only difference is that these hav…

---

## [Idea: A simple plugin system for CmdStan](https://discourse.mc-stan.org/t/idea-a-simple-plugin-system-for-cmdstan/38632)

<div class="topic-metadata">

**Author:** [@martinmodrak](https://discourse.mc-stan.org/u/martinmodrak)\
**Replies:** 4\
**Last updated:** [February 11, 2025, 10:58pm UTC](https://discourse.mc-stan.org/t/idea-a-simple-plugin-system-for-cmdstan/38632 "2025-02-11T22:58:54Z")

</div>

Note: this is an idea that I’ve been thinking about for a while and which came up relevant to How to evaluate samplers for inclusion in Stan? At this point, I can’t back that idea up with manpower to implement it, so it …

---

## [Problem Installing CmdStan on macOS - Bad CPU type in executable](https://discourse.mc-stan.org/t/problem-installing-cmdstan-on-macos-bad-cpu-type-in-executable/38545)

<div class="topic-metadata">

**Author:** [@kakei-hi](https://discourse.mc-stan.org/u/kakei-hi)\
**Replies:** 6\
**Last updated:** [January 21, 2025, 3:52am UTC](https://discourse.mc-stan.org/t/problem-installing-cmdstan-on-macos-bad-cpu-type-in-executable/38545 "2025-01-21T03:52:42Z")

</div>

I cannot install cmdstan on my MacBook Pro (M4Max). I was able to install it without any issues on other Macs with M2Ultra and M2Max. What could be the reason for the installation failure? What should I improve to suc…

---

## [Cmdstan initial set up "expecting target : dependencies"](https://discourse.mc-stan.org/t/cmdstan-initial-set-up-expecting-target-dependencies/37227)

<div class="topic-metadata">

**Author:** [@jmh530](https://discourse.mc-stan.org/u/jmh530)\
**Replies:** 2\
**Last updated:** [November 12, 2024, 3:24pm UTC](https://discourse.mc-stan.org/t/cmdstan-initial-set-up-expecting-target-dependencies/37227 "2024-11-12T15:24:21Z")

</div>

I recently installed cmdstanr for the first time on a Windows 10 machine. The installation seems to be successful. I was able to run the example without issue. However, I seem to be having an issue using cmdstan itself …

---

## [Lengthy errors on "cmdstan\_model()" of cmdstanr](https://discourse.mc-stan.org/t/lengthy-errors-on-cmdstan-model-of-cmdstanr/36779)

<div class="topic-metadata">

**Author:** [@rrr](https://discourse.mc-stan.org/u/rrr)\
**Replies:** 8\
**Last updated:** [October 29, 2024, 3:51pm UTC](https://discourse.mc-stan.org/t/lengthy-errors-on-cmdstan-model-of-cmdstanr/36779 "2024-10-29T15:51:45Z")

</div>

I have installed cmdstanr and cmdstan, following the guidance on https://mc-stan.org/cmdstanr/articles/cmdstanr.html . Operating System: macOS Sequoia 15.0 CmdStan Version: 2.35.0 Compiler/Toolkit: CLI When I try to g…

---

## [\[OLD\] Introducing Stan Playground - A Web-Based Platform for Stan Programming and Collaboration](https://discourse.mc-stan.org/t/old-introducing-stan-playground-a-web-based-platform-for-stan-programming-and-collaboration/31653)

<div class="topic-metadata">

**Author:** [@magland](https://discourse.mc-stan.org/u/magland)\
**Replies:** 3\
**Last updated:** [October 28, 2024, 2:48pm UTC](https://discourse.mc-stan.org/t/old-introducing-stan-playground-a-web-based-platform-for-stan-programming-and-collaboration/31653 "2024-10-28T14:48:40Z")

</div>

Note: For anyone finding this thread. This has been replaced by a brand new version: Original post: Hello everyone, I’m excited to share a new piece of open-source software called Stan Playground. This is a web-based…

---

## [Including Phylogenetic Information in a Bayesian Hierarchical Model for Predicting Species Trait](https://discourse.mc-stan.org/t/including-phylogenetic-information-in-a-bayesian-hierarchical-model-for-predicting-species-trait/36530)

<div class="topic-metadata">

**Author:** [@Alex\_Fuster](https://discourse.mc-stan.org/u/Alex_Fuster)\
**Replies:** 1\
**Last updated:** [September 19, 2024, 12:15pm UTC](https://discourse.mc-stan.org/t/including-phylogenetic-information-in-a-bayesian-hierarchical-model-for-predicting-species-trait/36530 "2024-09-19T12:15:44Z")

</div>

Hello, I am working on a Bayesian hierarchical model in Stan to predict the shell brightness of snail species based on several factors: habitat type, vegetation zone, island area, and island age. Additionally, I want to…

---

## [Brms/cmdstan with OpenCL: chains finish unexpectedly](https://discourse.mc-stan.org/t/brms-cmdstan-with-opencl-chains-finish-unexpectedly/36014)

<div class="topic-metadata">

**Author:** [@JoFrhwld](https://discourse.mc-stan.org/u/JoFrhwld)\
**Replies:** 2\
**Last updated:** [July 31, 2024, 7:23am UTC](https://discourse.mc-stan.org/t/brms-cmdstan-with-opencl-chains-finish-unexpectedly/36014 "2024-07-31T07:23:10Z")

</div>

I’m trying to speed up a model on an HPC by using the OpenCL support through CmdStan. To get everything up and running, I’ve had to create my own docker image (https://hub.docker.com/r/jofrhwld/stan-opencl). All of the d…

---

## [Question about a Log-Link function for a cognitive model](https://discourse.mc-stan.org/t/question-about-a-log-link-function-for-a-cognitive-model/35997)

<div class="topic-metadata">

**Author:** [@jangoe](https://discourse.mc-stan.org/u/jangoe)\
**Replies:** 1\
**Last updated:** [July 26, 2024, 1:17pm UTC](https://discourse.mc-stan.org/t/question-about-a-log-link-function-for-a-cognitive-model/35997 "2024-07-26T13:17:08Z")

</div>

Hey folks, I have a question regarding the implementation of certain link function outside of the brms framework, namely for cognitive models. I got a relatively simple hierachical cognitive model with 3 parameters: fu…

---

## [Pathfinder results for deterministically determined transformations](https://discourse.mc-stan.org/t/pathfinder-results-for-deterministically-determined-transformations/35769)

<div class="topic-metadata">

**Author:** [@aakhmetz](https://discourse.mc-stan.org/u/aakhmetz)\
**Replies:** 1\
**Last updated:** [July 11, 2024, 9:00pm UTC](https://discourse.mc-stan.org/t/pathfinder-results-for-deterministically-determined-transformations/35769 "2024-07-11T21:00:39Z")

</div>

Hello all, I use pathfinder to set the initial values, and I roughly understand the idea beneath it. However, I wonder about the transformations. In my code I define the variable real logphi and then do its transformati…

---

## [Four chains vs four jobs](https://discourse.mc-stan.org/t/four-chains-vs-four-jobs/35542)

<div class="topic-metadata">

**Author:** [@Corey.Plate](https://discourse.mc-stan.org/u/Corey.Plate)\
**Replies:** 28\
**Last updated:** [June 19, 2024, 1:11am UTC](https://discourse.mc-stan.org/t/four-chains-vs-four-jobs/35542 "2024-06-19T01:11:28Z")

</div>

Hey everyone, We’re running into a bit of an issue on our cluster where Stan only seems to want to run two of the four chains in parallel (this is a new issue, Stan has not been recompiled, and the issue is replicated i…

---

## [Estimating correlations between fitted parameters](https://discourse.mc-stan.org/t/estimating-correlations-between-fitted-parameters/35406)

<div class="topic-metadata">

**Author:** [@Corey.Plate](https://discourse.mc-stan.org/u/Corey.Plate)\
**Replies:** 20\
**Last updated:** [June 17, 2024, 1:49pm UTC](https://discourse.mc-stan.org/t/estimating-correlations-between-fitted-parameters/35406 "2024-06-17T13:49:51Z")

</div>

Hey everyone, We’re interested in finding the correlations that underly fitted parameters for the same subjects between two experimental domains. We have a model that gives us a posterior for a parameter of interest fo…

---

## [Estimation of time-varying infection parameter for a simple SEIR model](https://discourse.mc-stan.org/t/estimation-of-time-varying-infection-parameter-for-a-simple-seir-model/35132)

<div class="topic-metadata">

**Author:** [@Akuno](https://discourse.mc-stan.org/u/Akuno)\
**Replies:** 0\
**Last updated:** [May 13, 2024, 6:30pm UTC](https://discourse.mc-stan.org/t/estimation-of-time-varying-infection-parameter-for-a-simple-seir-model/35132 "2024-05-13T18:30:10Z")

</div>

Dear all, I have been stuck on this topic for some time now. I am trying to estimate time-varying infection (with other time-independent epidemiological) parameters for a complex multi-patch SEIRS model. But I decided …

---

## [Continuing with optimization using lbfgs/bfgs when optimization is terminated](https://discourse.mc-stan.org/t/continuing-with-optimization-using-lbfgs-bfgs-when-optimization-is-terminated/34858)

<div class="topic-metadata">

**Author:** [@Garren\_Hermanus](https://discourse.mc-stan.org/u/Garren_Hermanus)\
**Replies:** 2\
**Last updated:** [April 23, 2024, 6:35pm UTC](https://discourse.mc-stan.org/t/continuing-with-optimization-using-lbfgs-bfgs-when-optimization-is-terminated/34858 "2024-04-23T18:35:53Z")

</div>

Hi all I just wanted to know if it possible to continue with an optimization when some stopping criteria is achieved (in this case the maximum number of iterations)? Practically speaking we should able to just use the f…

---

## [Passing command line arguments into Stan model code](https://discourse.mc-stan.org/t/passing-command-line-arguments-into-stan-model-code/34757)

<div class="topic-metadata">

**Author:** [@lizlawler](https://discourse.mc-stan.org/u/lizlawler)\
**Replies:** 3\
**Last updated:** [April 12, 2024, 12:32pm UTC](https://discourse.mc-stan.org/t/passing-command-line-arguments-into-stan-model-code/34757 "2024-04-12T12:32:00Z")

</div>

Overall question: Is there a way to pass an argument from the command line into .stan model code, to alter a function that’s being used in the transformed parameters block? I don’t think I’m asking this correctly, but ho…

---

## [Problem running cmdstan on computing cluster](https://discourse.mc-stan.org/t/problem-running-cmdstan-on-computing-cluster/34747)

<div class="topic-metadata">

**Author:** [@kgoldfeld](https://discourse.mc-stan.org/u/kgoldfeld)\
**Replies:** 5\
**Last updated:** [April 11, 2024, 3:18pm UTC](https://discourse.mc-stan.org/t/problem-running-cmdstan-on-computing-cluster/34747 "2024-04-11T15:18:59Z")

</div>

My system admin just installed cmdstan 2.34.1 and cmdstanr 0.7.1 on the computing cluster. I am trying to run the bernoulli example. Here is the log file. I am trying to help them troubleshoot, and was wondering if it i…

---

## [fit$loo(moment\_match=T) not returning different results from fit$loo()](https://discourse.mc-stan.org/t/fit-loo-moment-match-t-not-returning-different-results-from-fit-loo/34608)

<div class="topic-metadata">

**Author:** [@lizlawler](https://discourse.mc-stan.org/u/lizlawler)\
**Replies:** 9\
**Last updated:** [April 6, 2024, 12:50am UTC](https://discourse.mc-stan.org/t/fit-loo-moment-match-t-not-returning-different-results-from-fit-loo/34608 "2024-04-06T00:50:38Z")

</div>

I’m encountering an issue using moment matching on a CmdStanFit object. I’ve followed the helpful info here to recreate a dummy model object, since I am running this on a bunch of models that I’ve fit using cmdstan from …

---

## [Pathfinder does not accept multiple inits?](https://discourse.mc-stan.org/t/pathfinder-does-not-accept-multiple-inits/34580)

<div class="topic-metadata">

**Author:** [@Garren\_Hermanus](https://discourse.mc-stan.org/u/Garren_Hermanus)\
**Replies:** 2\
**Last updated:** [March 25, 2024, 6:56pm UTC](https://discourse.mc-stan.org/t/pathfinder-does-not-accept-multiple-inits/34580 "2024-03-25T18:56:04Z")

</div>

Hi all I just wanted to know why pathfinder does not accept multiple inits as an argument? I would’ve expected this to be the case since we can set the num\_paths variable, thus similar to the sample method’s chains. I t…

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