# \#cmdstanpy

**URL:** https://discourse.mc-stan.org/tag/cmdstanpy/64.md?match_all_tags=true&page=1&tags%5B%5D=cmdstanpy

[Latest](https://discourse.mc-stan.org/latest.md) · [Categories](https://discourse.mc-stan.org/categories.md) · [Tags](https://discourse.mc-stan.org/tags.md)

**Page:** 2

---

## [Kalman-type model](https://discourse.mc-stan.org/t/kalman-type-model/33647)

<div class="topic-metadata">

**Author:** [@fponce](https://discourse.mc-stan.org/u/fponce)\
**Replies:** 2\
**Last updated:** [January 9, 2024, 8:49am UTC](https://discourse.mc-stan.org/t/kalman-type-model/33647 "2024-01-09T08:49:53Z")

</div>

(Simplified) model I have a system that evolves in time (discrete time), and a signal x \\in \\mathbb{R} can be measured at every time. The state of the system s \\in \\mathbb{R} has the constrain s\> 0, and the signal x dep…

---

## [Fresh Conda installation of cmdstanpy does not work with bernoulli.stan example](https://discourse.mc-stan.org/t/fresh-conda-installation-of-cmdstanpy-does-not-work-with-bernoulli-stan-example/33672)

<div class="topic-metadata">

**Author:** [@mjblotinga](https://discourse.mc-stan.org/u/mjblotinga)\
**Replies:** 4\
**Last updated:** [January 2, 2024, 2:34pm UTC](https://discourse.mc-stan.org/t/fresh-conda-installation-of-cmdstanpy-does-not-work-with-bernoulli-stan-example/33672 "2024-01-02T14:34:55Z")

</div>

Fresh Conda installation of cmdstanpy does not work with bernoulli.stan example. Have followed the installation instructions to create a new conda environment install of cmdstanpy (Conda 23.5.2, cmdstan 2.33.1, cmdstanp…

---

## [Cmdstanpy: multithreading issues (threads\_per\_chain)](https://discourse.mc-stan.org/t/cmdstanpy-multithreading-issues-threads-per-chain/33572)

<div class="topic-metadata">

**Author:** [@annelies](https://discourse.mc-stan.org/u/annelies)\
**Replies:** 2\
**Last updated:** [December 13, 2023, 3:02pm UTC](https://discourse.mc-stan.org/t/cmdstanpy-multithreading-issues-threads-per-chain/33572 "2023-12-13T15:02:02Z")

</div>

Hi all, I’ve been trying to run a stan model using cmdstanpy (it’s my first time using cmdstanpy) with 4 chains of 16 cores, I want my chains to be executed in parallel (cpp\_options={'STAN\_THREADS': 'TRUE'} is specified…

---

## [Changing the ouput files dir after fitting in cmdstanpy](https://discourse.mc-stan.org/t/changing-the-ouput-files-dir-after-fitting-in-cmdstanpy/33516)

<div class="topic-metadata">

**Author:** [@Garren\_Hermanus](https://discourse.mc-stan.org/u/Garren_Hermanus)\
**Replies:** 1\
**Last updated:** [December 6, 2023, 11:39pm UTC](https://discourse.mc-stan.org/t/changing-the-ouput-files-dir-after-fitting-in-cmdstanpy/33516 "2023-12-06T23:39:34Z")

</div>

Hey all, I am running my code on a server for which I give input to fit = model.sampling(..., output\_dit='output\_files/') After the fit is done, I save my fit object as a .pkl file(saved in binary) and I move the .pkl f…

---

## [Draws\_pd returns diagnostic data columns by default on cmdstanpy 1.2](https://discourse.mc-stan.org/t/draws-pd-returns-diagnostic-data-columns-by-default-on-cmdstanpy-1-2/33329)

<div class="topic-metadata">

**Author:** [@akcchoi](https://discourse.mc-stan.org/u/akcchoi)\
**Replies:** 3\
**Last updated:** [November 17, 2023, 5:52am UTC](https://discourse.mc-stan.org/t/draws-pd-returns-diagnostic-data-columns-by-default-on-cmdstanpy-1-2/33329 "2023-11-17T05:52:24Z")

</div>

Hi all, When calling \[CmdStanMCMC\].draws\_pd(“foo”), I would get a data frame with columns: chain\_\_, tier\_\_, and draw\_\_ in addition to the “foo” When calling \[CmdStanMCMC\].draws\_pd(). I wold get a data frame with column…

---

## [Building cmdstan in a docker container to run orbit-ml](https://discourse.mc-stan.org/t/building-cmdstan-in-a-docker-container-to-run-orbit-ml/33272)

<div class="topic-metadata">

**Author:** [@mikev](https://discourse.mc-stan.org/u/mikev)\
**Replies:** 3\
**Last updated:** [November 16, 2023, 2:30pm UTC](https://discourse.mc-stan.org/t/building-cmdstan-in-a-docker-container-to-run-orbit-ml/33272 "2023-11-16T14:30:29Z")

</div>

First, I apologize if this question is way off base. This is not my wheelhouse. I’m trying to use orbit-ml (1.1.4) in a docker container as part of a CI/CD pipeline running python 3.9. As part of my dockerfile, I pip in…

---

## [Cmdstanpy==1.2.0, arviz and no attribute 'stan\_vars\_cols'](https://discourse.mc-stan.org/t/cmdstanpy-1-2-0-arviz-and-no-attribute-stan-vars-cols/33266)

<div class="topic-metadata">

**Author:** [@Duncan\_Stoddard](https://discourse.mc-stan.org/u/Duncan_Stoddard)\
**Replies:** 2\
**Last updated:** [November 8, 2023, 3:59pm UTC](https://discourse.mc-stan.org/t/cmdstanpy-1-2-0-arviz-and-no-attribute-stan-vars-cols/33266 "2023-11-08T15:59:56Z")

</div>

Hello, I’ve upgraded cmdstanpy to 1.2.0. When I try to create an InferenceData object with arviz==0.16.1 I get the below error. It works fine with cmdstanpy=1.1.0. Get the same with the eight schools example. ---------…

---

## [How to enter discrete data to stan model and modelling mixed posterior probability?](https://discourse.mc-stan.org/t/how-to-enter-discrete-data-to-stan-model-and-modelling-mixed-posterior-probability/31283)

<div class="topic-metadata">

**Author:** [@Meqdad\_Hasan](https://discourse.mc-stan.org/u/Meqdad_Hasan)\
**Replies:** 3\
**Last updated:** [October 13, 2023, 5:43pm UTC](https://discourse.mc-stan.org/t/how-to-enter-discrete-data-to-stan-model-and-modelling-mixed-posterior-probability/31283 "2023-10-13T17:43:56Z")

</div>

Hello stan users; I am new to stan. I still can not use \<I got the whole concept of stan language. However, I am in a hurry to answer one of my main questions. I am trying to model 46 nodes with almost 82 connections Ba…

---

## [How to run generate quantities with PyStan](https://discourse.mc-stan.org/t/how-to-run-generate-quantities-with-pystan/32916)

<div class="topic-metadata">

**Author:** [@fponce](https://discourse.mc-stan.org/u/fponce)\
**Replies:** 7\
**Last updated:** [September 29, 2023, 10:18am UTC](https://discourse.mc-stan.org/t/how-to-run-generate-quantities-with-pystan/32916 "2023-09-29T10:18:47Z")

</div>

I am learning about posterior predictive inference from this page. The author uses CmdStan, but I am using pystan, and it is already confusing to see two interfaces, but I try to ignore this fact. The author uses the me…

---

## [Parameters way off with variational inference, not sure why](https://discourse.mc-stan.org/t/parameters-way-off-with-variational-inference-not-sure-why/32449)

<div class="topic-metadata">

**Author:** [@dherrera1911](https://discourse.mc-stan.org/u/dherrera1911)\
**Replies:** 2\
**Last updated:** [August 23, 2023, 6:44pm UTC](https://discourse.mc-stan.org/t/parameters-way-off-with-variational-inference-not-sure-why/32449 "2023-08-23T18:44:11Z")

</div>

I am trying to fit a model to some simulated neural data. In the simulated data, I have a set of neurons indexed by i={1, ..., N} and two conditions, a baseline condition Stimulation=0 and a stimulated condition Stimulat…

---

## [Problems with posteriors of parameters in Bayesian hierarchical model (cmdstanpy)](https://discourse.mc-stan.org/t/problems-with-posteriors-of-parameters-in-bayesian-hierarchical-model-cmdstanpy/32376)

<div class="topic-metadata">

**Author:** [@Simon\_Smith](https://discourse.mc-stan.org/u/Simon_Smith)\
**Replies:** 1\
**Last updated:** [August 22, 2023, 3:23pm UTC](https://discourse.mc-stan.org/t/problems-with-posteriors-of-parameters-in-bayesian-hierarchical-model-cmdstanpy/32376 "2023-08-22T15:23:51Z")

</div>

Hi there, I’m having a problem getting the modes of my posterior probability distributions lining up to what I’d expect them to be, given the data I am learning from. I am using the package cmdstanpy. I have a generate…

---

## [Issues with cmdstanpy on Apple Silicon and newest MacOS](https://discourse.mc-stan.org/t/issues-with-cmdstanpy-on-apple-silicon-and-newest-macos/26869)

<div class="topic-metadata">

**Author:** [@jbaranowski](https://discourse.mc-stan.org/u/jbaranowski)\
**Replies:** 31\
**Last updated:** [August 18, 2023, 1:19pm UTC](https://discourse.mc-stan.org/t/issues-with-cmdstanpy-on-apple-silicon-and-newest-macos/26869 "2023-08-18T13:19:43Z")

</div>

Does anybody have problems with getting cmdstanpy to work with macOS 12.3 and Apple Silicon? Details are here Issue at GitHub but generally it stopped compiling when building cmdstan. I’ve exhausted all ideas except re…

---

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

---

## [Modelling a timeseries as a 2D field including AR1 noise and smooth seasonal cycle and trend (new to bayes and stan)](https://discourse.mc-stan.org/t/modelling-a-timeseries-as-a-2d-field-including-ar1-noise-and-smooth-seasonal-cycle-and-trend-new-to-bayes-and-stan/32313)

<div class="topic-metadata">

**Author:** [@ezra\_eisbrenner](https://discourse.mc-stan.org/u/ezra_eisbrenner)\
**Replies:** 2\
**Last updated:** [August 2, 2023, 9:22am UTC](https://discourse.mc-stan.org/t/modelling-a-timeseries-as-a-2d-field-including-ar1-noise-and-smooth-seasonal-cycle-and-trend-new-to-bayes-and-stan/32313 "2023-08-02T09:22:27Z")

</div>

Before I start, hi there Stan community! I’m both new to Bayesian statistics and to Stan, so feel free to comment on anything you think is worth commenting on :) The goal I like to model sea surface temperatures (SST) i…

---

## [Dyld library not loaded - CmdStanPy / Anaconda](https://discourse.mc-stan.org/t/dyld-library-not-loaded-cmdstanpy-anaconda/31347)

<div class="topic-metadata">

**Author:** [@pablogalazcares](https://discourse.mc-stan.org/u/pablogalazcares)\
**Replies:** 0\
**Last updated:** [May 11, 2023, 1:07am UTC](https://discourse.mc-stan.org/t/dyld-library-not-loaded-cmdstanpy-anaconda/31347 "2023-05-11T01:07:22Z")

</div>

Hello everyone!I’m sampling a model in MacBook Pro, M1 Pro, 16 GB ram, macOS Ventura 13.3.1. CmdStanPy v1.1.0 . When I tried the example model (bernoulli) everything worked in a good way (image 1). But, when I tried with…

---

## [Cookiecutter-cmdstanpy: a template for cmdstanpy projects](https://discourse.mc-stan.org/t/cookiecutter-cmdstanpy-a-template-for-cmdstanpy-projects/21310)

<div class="topic-metadata">

**Author:** [@Teddy\_Groves1](https://discourse.mc-stan.org/u/Teddy_Groves1)\
**Replies:** 24\
**Last updated:** [April 6, 2023, 9:48am UTC](https://discourse.mc-stan.org/t/cookiecutter-cmdstanpy-a-template-for-cmdstanpy-projects/21310 "2023-04-06T09:48:09Z")

</div>

I am writing a template for cmdstanpy analyses called cookiecutter-cmdstanpy and would be really grateful for any feedback on the work done so far. The overall idea is to avoid repeating work - instead of manually creat…

---

## [Fitting the same model to many datasets](https://discourse.mc-stan.org/t/fitting-the-same-model-to-many-datasets/29445)

<div class="topic-metadata">

**Author:** [@energyatinfinity](https://discourse.mc-stan.org/u/energyatinfinity)\
**Replies:** 9\
**Last updated:** [November 22, 2022, 7:41pm UTC](https://discourse.mc-stan.org/t/fitting-the-same-model-to-many-datasets/29445 "2022-11-22T19:41:58Z")

</div>

I have a use case where I’m fitting a simple linear regression model to many datasets. The code below works, but for fitting 1,000s or 10,000s of datasets I’d like to optimize it to make better use of eg. a multi-core CP…

---

## [MCMC approximation of posterior for a simple model of human attention (Divergent transitions)](https://discourse.mc-stan.org/t/mcmc-approximation-of-posterior-for-a-simple-model-of-human-attention-divergent-transitions/29544)

<div class="topic-metadata">

**Author:** [@mrnoodle](https://discourse.mc-stan.org/u/mrnoodle)\
**Replies:** 0\
**Last updated:** [November 19, 2022, 10:44pm UTC](https://discourse.mc-stan.org/t/mcmc-approximation-of-posterior-for-a-simple-model-of-human-attention-divergent-transitions/29544 "2022-11-19T22:44:21Z")

</div>

Hey friends! I’m working on a probabilistic model of human attention. The model is defined by the following problem: We want to learn the \\mu and \\sigma of Gaussian random variable y via Bayesian inference. We have some…

---

## [Cmdstanpy error in fit.summary()?](https://discourse.mc-stan.org/t/cmdstanpy-error-in-fit-summary/26939)

<div class="topic-metadata">

**Author:** [@cpbl](https://discourse.mc-stan.org/u/cpbl)\
**Replies:** 20\
**Last updated:** [November 11, 2022, 7:10pm UTC](https://discourse.mc-stan.org/t/cmdstanpy-error-in-fit-summary/26939 "2022-11-11T19:10:49Z")

</div>

I have whittled a bug in my results down to this disturbing discrepancy between fit.summary() and fit.draws\_pd().describe(). It seems the former is (a) rounding by significant figures , but also (b) making mistakes. In…

---

## [The variational inference example doesn't work](https://discourse.mc-stan.org/t/the-variational-inference-example-doesnt-work/29360)

<div class="topic-metadata">

**Author:** [@voyager](https://discourse.mc-stan.org/u/voyager)\
**Replies:** 2\
**Last updated:** [November 7, 2022, 2:11pm UTC](https://discourse.mc-stan.org/t/the-variational-inference-example-doesnt-work/29360 "2022-11-07T14:11:21Z")

</div>

Errors vi = model.variational(data=data\_file) 09:23:52 - cmdstanpy - INFO - Chain \[1\] start processing 09:23:52 - cmdstanpy - INFO - Chain \[1\] done processing 09:23:52 - cmdstanpy - ERROR - Chain \[1\] error: error during…

---

## [Any examples of using LFO-CV with cmdstanpy?](https://discourse.mc-stan.org/t/any-examples-of-using-lfo-cv-with-cmdstanpy/28430)

<div class="topic-metadata">

**Author:** [@mathDR](https://discourse.mc-stan.org/u/mathDR)\
**Replies:** 7\
**Last updated:** [August 16, 2022, 4:53pm UTC](https://discourse.mc-stan.org/t/any-examples-of-using-lfo-cv-with-cmdstanpy/28430 "2022-08-16T16:53:51Z")

</div>

Just wondering if anyone has an example of using Leave Future Out CV with cmdstanpy? I see the vingette here which uses brms and R heavily. If not, I would be happy to implement it! I just don’t want to recreate the w…

---

## [Cmdstanpy error signal 3221225349](https://discourse.mc-stan.org/t/cmdstanpy-error-signal-3221225349/28148)

<div class="topic-metadata">

**Author:** [@mingqian.guo](https://discourse.mc-stan.org/u/mingqian.guo)\
**Replies:** 1\
**Last updated:** [August 2, 2022, 3:55pm UTC](https://discourse.mc-stan.org/t/cmdstanpy-error-signal-3221225349/28148 "2022-08-02T15:55:34Z")

</div>

Dear stan experts, I am trying to fit a model with cmdstanpy and suddenly a error came out that chain 1 is terminated. Here is the error warning. What’s the meaning of this warning? Thanks. cmdstanpy - ERROR - Chain \[1…

---

## [New way of packaging Stan models in Python](https://discourse.mc-stan.org/t/new-way-of-packaging-stan-models-in-python/28406)

<div class="topic-metadata">

**Author:** [@WardBrian](https://discourse.mc-stan.org/u/WardBrian)\
**Replies:** 0\
**Last updated:** [August 2, 2022, 2:08pm UTC](https://discourse.mc-stan.org/t/new-way-of-packaging-stan-models-in-python/28406 "2022-08-02T14:08:08Z")

</div>

Hi all - This is the announcement of the first version of cookiecutter-cmdstanpy-wrapper. Do you have a Stan model that you want to distribute as part of a Python package? This template provides the extra setup.py work…

---

## [Cmdstanpy with GPU/OpenCL](https://discourse.mc-stan.org/t/cmdstanpy-with-gpu-opencl/28064)

<div class="topic-metadata">

**Author:** [@akcchoi](https://discourse.mc-stan.org/u/akcchoi)\
**Replies:** 4\
**Last updated:** [July 11, 2022, 8:16am UTC](https://discourse.mc-stan.org/t/cmdstanpy-with-gpu-opencl/28064 "2022-07-11T08:16:03Z")

</div>

HI all, I wonder if there is a documentation on running cmdstandpy with GPU (similar to the one for cmdstanr from here: https://mc-stan.org/cmdstanr/articles/articles-online-only/opencl.html From the cmdstanr GPU docum…

---

## [DLL issue using CmdStanPy on Win10 with Jupyter: \`ImportError: DLL load failed while importing \_ctypes\`](https://discourse.mc-stan.org/t/dll-issue-using-cmdstanpy-on-win10-with-jupyter-importerror-dll-load-failed-while-importing-ctypes/27927)

<div class="topic-metadata">

**Author:** [@gregor](https://discourse.mc-stan.org/u/gregor)\
**Replies:** 3\
**Last updated:** [June 25, 2022, 9:07pm UTC](https://discourse.mc-stan.org/t/dll-issue-using-cmdstanpy-on-win10-with-jupyter-importerror-dll-load-failed-while-importing-ctypes/27927 "2022-06-25T21:07:07Z")

</div>

I’ve set up CmdStanPy on Windows 10 using Anaconda (in a dedicated env). C++ toolchain is working, and I can execute the bernoulli example via cmdline. I’d like to set up jupyter in this env to conveniently interface wi…

---

## [Possible to specify compiled executable filename/extension?](https://discourse.mc-stan.org/t/possible-to-specify-compiled-executable-filename-extension/27907)

<div class="topic-metadata">

**Author:** [@gibsramen](https://discourse.mc-stan.org/u/gibsramen)\
**Replies:** 1\
**Last updated:** [June 22, 2022, 12:49am UTC](https://discourse.mc-stan.org/t/possible-to-specify-compiled-executable-filename-extension/27907 "2022-06-22T00:49:06Z")

</div>

Howdy, folks. I’m wondering if it is possible to specify an extension to the compiled Stan executable. From my understanding, when compiling a Stan file (I use CmdStanPy) two files are generated: model\_name.hpp & model…

---

## [CmdStanPy - read Stan model from Github](https://discourse.mc-stan.org/t/cmdstanpy-read-stan-model-from-github/27870)

<div class="topic-metadata">

**Author:** [@Domenic\_Di\_Francesco](https://discourse.mc-stan.org/u/Domenic_Di_Francesco)\
**Replies:** 6\
**Last updated:** [June 20, 2022, 8:37pm UTC](https://discourse.mc-stan.org/t/cmdstanpy-read-stan-model-from-github/27870 "2022-06-20T20:37:18Z")

</div>

Hi all, The below code let’s me read a Stan file in R model \<- url("GitHub\_page") |\> readLines() |\> cmdstanr::write\_stan\_file() |\> cmdstanr::cmdstan\_model() Is it possible to do this in Python too, using CmdSta…

---

## [Switching To Using Stan With Python On Windows, Which Interface To Use?](https://discourse.mc-stan.org/t/switching-to-using-stan-with-python-on-windows-which-interface-to-use/27687)

<div class="topic-metadata">

**Author:** [@Dathis](https://discourse.mc-stan.org/u/Dathis)\
**Replies:** 2\
**Last updated:** [May 31, 2022, 6:19pm UTC](https://discourse.mc-stan.org/t/switching-to-using-stan-with-python-on-windows-which-interface-to-use/27687 "2022-05-31T18:19:28Z")

</div>

I’m new to stan but I’ve used the rstan package a few times, but I want to switch to python so i can better intergrate with other programs and packages. Looking at the documentation, it looks like you have to install WS…

---

## [Cmdstan(py) for Ubuntu 22.04](https://discourse.mc-stan.org/t/cmdstan-py-for-ubuntu-22-04/27300)

<div class="topic-metadata">

**Author:** [@aakhmetz](https://discourse.mc-stan.org/u/aakhmetz)\
**Replies:** 8\
**Last updated:** [May 28, 2022, 10:10pm UTC](https://discourse.mc-stan.org/t/cmdstan-py-for-ubuntu-22-04/27300 "2022-05-28T22:10:56Z")

</div>

I am wondering if someone was successful with running the cmdstan on Ubuntu 22.04. I tried, but it looks not good to me: Bernoulli example compiles with no problem, but then I almost always get: CmdStan's precompiled he…

---

## [Blog post on CmdStanPy\<-\>ArviZ integration](https://discourse.mc-stan.org/t/blog-post-on-cmdstanpy-arviz-integration/27260)

<div class="topic-metadata">

**Author:** [@OriolAbril](https://discourse.mc-stan.org/u/OriolAbril)\
**Replies:** 0\
**Last updated:** [April 26, 2022, 4:43am UTC](https://discourse.mc-stan.org/t/blog-post-on-cmdstanpy-arviz-integration/27260 "2022-04-26T04:43:23Z")

</div>

I have written a blog post focused on the integration between CmdStanPy and ArviZ and how to use them to ease postprocessing and exploratory analysis of models. It uses the models from the Tagging Basketball Events with …

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

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