Questions tagged [pystan]

The Python Interface to Stan

PyStan provides an interface to Stan, a package for Bayesian inference using the No-U-Turn sampler, a variant of Hamiltonian Monte Carlo.

Resources:

86 questions
2
votes
1 answer

How to force PyStan to recompile a stan model?

I have a weighted Bayesian Logistic Regression model weighted_stan_representation = """ data { int n; // number of observations int d; // number of predictors array[n] int y; // outputs matrix[n,d] x; //…
1809
  • 33
  • 3
2
votes
1 answer

How to install pystan on miniforge for Mac M1?

I have a 2020 Mac M1 running Miniforge3-MacOSX-arm64 for Apple Silicon. I have tried pip install pystan and gets the following error error: legacy-install-failure × Encountered error while trying to install package. ╰─> pystan I have also tried…
slcao
  • 21
  • 1
2
votes
0 answers

installing fbprophet in docker file docker build on M1 Mac does not work

Does anyone know how to install fbprophet in the docker file for the Mac M1 pro ? As I am unable to install it citing below is instructions saved in a text file named "dockerfile": FROM jupyter/scipy-notebook:python-3.9.7 RUN pip install…
2
votes
1 answer

Can't pip install pystan

I am not able to pip install fbprophet neither to pip install pystan. I am using VS Code and Python 3.9.3 64-bit on Windows 10. I also updated to the newest version of Visual Studio Build tools (16.11.3) since some people are saying, you need at…
dnnsqe
  • 25
  • 1
  • 5
2
votes
1 answer

AttributeError: module 'pystan' has no attribute 'StanModel'

After running the following line (already exist the package): pip install -vvv pystan Requirement already satisfied: pystan in /Users/cmougan/anaconda3/lib/python3.6/site-packages (2.17.1.0) Requirement already satisfied: Cython!=0.25.1,>=0.22 in…
Carlos Mougan
  • 761
  • 1
  • 8
  • 21
2
votes
1 answer

Fbprophet / pystan

I am tying to install Fbprophet (python) I followed all installation instructions (anaconda). If I try to run Fbprophet in my anaconda prompt it works fine. However, when I create a project in Visual studio 2017 I get the following error…
2
votes
0 answers

Is there a way to install mingw-64 on windows in a virtual enviroment?

Im trying to install pystan and facebook-prophet in a virtual enviroment. But it needed mingw-64 and libpython in able to run it. All the instructions are using conda. Is there a way to install mingw-64 and libpython in a virtual enviroment without…
Maki
  • 201
  • 5
  • 11
2
votes
1 answer

Highest Density Interval (HDI) for Posterior Distribution Pystan

I am seeing that in Pystan, an HDI function can be used to provide a 95% credible interval surrounding the posterior distribution. However, they say it will only work for unimodal distributions. If my model may have a multimodal distribution (up to…
nik jacks
  • 75
  • 1
  • 5
2
votes
5 answers

PyStan: CompileError: command 'gcc' failed with exit status 1 (macos)

This is a PyStan model that I am trying to run. However, once I try to run it I come across the following error: CompileError: command 'gcc' failed with exit status 1 Any idea how this error could be fixed on the macOS? counts = [0.0711, 0.125,…
Ewa Szyszka
  • 69
  • 2
  • 10
2
votes
1 answer

extract().to_dataframe() from a StanFit4Model does not work on pystan 2.18

I have estimated a model using pystan: import pystan stan_model = pystan.StanModel('stan_codes/stan_code_1.stan') samples = stan_model.sampling(data = sdata, iter = 10, chains = 1, seed = 42) model_results = {'mdata' : model_data, 'sdata': sdata,…
quant
  • 4,062
  • 5
  • 29
  • 70
2
votes
2 answers

Efficiently sample a collection of multi-normal variables with varying sigma (covariance) matrix

I'm new to Stan, so hoping you can point me in the right direction. I'll build up to my situation to make sure we're on the same page... If I had a collection of univariate normals, the docs tell me that: y ~ normal(mu_vec, sigma); provides the…
8one6
  • 13,078
  • 12
  • 62
  • 84
2
votes
1 answer

How to store PyStan object as a binary?

I want to store the intermediate files in Probabilistic Programming steps with Stan such as fit object, see the SWE below, into a file so I can load it later for later usage. Stan compiles the models in C++ and after each run, I would not want to…
hhh
  • 50,788
  • 62
  • 179
  • 282
2
votes
1 answer

Can you use sample weights in pystan or pymc3?

If my observed dataset has weights (for example tracking multiplicity) is it possible to provide this either to pystan or pymc3, similar to the function signature (http://mc-stan.org/rstanarm/reference/stan_glm.html) in the rstanarm…
maxymoo
  • 35,286
  • 11
  • 92
  • 119
1
vote
1 answer

Migrating from PyStan2 to PyStan3

The following Python code assumes the usage of pystan 2. However, when running it with pystan 3, it raises an error stating that algorithm='Fixed_param' is unknown. In the case of pystan 3, what modifications are required apart from changing import…
Joe Suzuki
  • 41
  • 3
1
vote
1 answer

Pystan -- Library\\mingw-w64\\bin\\gcc.exe' failed with exit code 1

I would like to test orbit-ml package but I have same issues with pystan My settings are: Windows10, Anacaonda, Python 3.7 (or 3.8) When I run this demo code: import pystan model_code = 'parameters {real y;} model {y ~ normal(0,1);}' model =…
cervus_pc
  • 25
  • 3