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
1
vote
1 answer

How to use brms (R package) to generate the Stan code I need to reproduce the models estimation in pystan?

I have developed the pipeline to estimate a model using the R package brms and now I need to convert it to python. I understand that the closest I can get to brms in python is pystan where I have to write my model using the Stan syntax. I would like…
ThiagoSC
  • 69
  • 1
  • 9
1
vote
0 answers

Make a binary wheel for pip, from within conda environment

I want to use the library fbprophet for python, on Windows 64 bits. It depends on pystan, which is hard to install on windows (on Linux, a simple "pip install pystan" was enough). On the doc, they explain how to install it in a conda environment,…
Maxx
  • 278
  • 1
  • 3
  • 16
1
vote
1 answer

Stan: how to use variational inference to fit a distribution

Let‘s assume that I have a Poisson distribution with gamma=10. I would like to fit a Gaussian distribution, which minimizes KL divergence to the Poisson distribution. This is possible with variational inference. How can I use Stan to do this…
lhk
  • 27,458
  • 30
  • 122
  • 201
1
vote
8 answers

Running setup.py install for fbprophet ... error

I cannot install fbprophet or gcc7. I have manually installed a precompiled ephem. Running setup.py install for fbprophet ... error I have tried with python 3.6 and 3.7. I have tried running as administrator and without. My anaconda prompt cannot…
Cam K
  • 127
  • 2
  • 2
  • 13
1
vote
0 answers

Stan vs PYMC3 for Discrete Mixture Models

I am studying zero-inflated count temporal data. I have built a stan model that deals with this zero-inflated data with an if statement in the model block. This is as they advise in the Stan Reference Guide. e.g., model { for (n in 1:N) { …
nick
  • 1,310
  • 8
  • 15
1
vote
0 answers

"Error: variable "real" does not exist in the model block" in Stan

I am following the example code using Stan in Python but it is not compiled because of the syntax error: ValueError: Failed to parse Stan model 'anon_model_ad43313e8b4b0b001a1a5d32da64a34e'. Error message: SYNTAX ERROR, MESSAGE(S) FROM…
Eunji Lee
  • 33
  • 4
1
vote
0 answers

Issues importing FBPROPHET on Jupyter notebook running on Python3.6

I am running Jupyter on CenstOS server. I used 'Conda install pystan' and 'conda install -c conda-forge pystan' but everytime in import either pystan or fbprohet i get the error "No module named 'pystan._api'". Kindly help
Aditi Shah
  • 64
  • 2
  • 11
0
votes
0 answers

Using Dirichlet distribution in Stan

I'm testing the Dirichlet distribution with pyStan 3.7. I'm getting a warning that alpha has two prior, I don't get why. data { int T; int K; int y[T, K]; } parameters { simplex[K] theta[T]; real alpha;…
Bob
  • 10,741
  • 27
  • 89
  • 143
0
votes
0 answers

AttributeError: 'Prophet' object has no attribute 'stan_backend' while running m=Prophet()

anyone know how to resolve this issue while using Prophet library. AttributeError: 'Prophet' object has no attribute 'stan_backend' while running m=Prophet(). I have following versions of packages pystan: 2.19.1.1 prophet: 1.1.4 cmstanpy :…
user3585510
  • 131
  • 2
  • 10
0
votes
0 answers

(conda environment) distutils.errors.CompileError: command 'x86_64-conda-linux-gnu-cc' failed with exit status 1

I need pystan to run a certain program (DLM), but I need a version <= 2.19.1.1, because otherwise, apparently, import pystan does not work and I don't want to modify the program. I need to run on HPC (SUSE Linux Enterprise Server 12 SP3, relase…
theWrongAlice
  • 99
  • 2
  • 10
0
votes
1 answer

Segmentation fault in PyStan

I am learning pystan and I tried to run the following code, which I copy-pasted from here: #/my_file.py import pystan as ps import numpy as np model = """ data { int N; vector[N] x; vector[N] y; } parameters { real alpha; …
user90189
  • 123
  • 5
0
votes
0 answers

How can we install fbprophet and pystan in conda prompt or in window prompt

I have problem while installing fbprophet module in windows or in conda. In windows command prompt it says this error originates from a subprocess, and is likely not a problem with pip while in conda prompt it says The current user does not have…
0
votes
0 answers

Fitting a image with 2d gaussian in Stan

I’m trying to fit an image of (matrix of NxN) dimension, but I don’t figure out how to do it. I suppose that my model has to be a y ~multi_normal (mu, Sigma) with mu a vector of values mu_x and mu_y and Sigma a cov matrix. I’m writing a simple Stan…
Antonio
  • 1
  • 2
0
votes
0 answers

Issues in installing FBProbhet library and Pystan module for Python 3.10

I am trying to install FBProphet library in Python 3.10, but it fails because I do not have the pystan module installed. But then when I try to install pystan, it fails on this error: error: could not create…
0
votes
0 answers

Error: subprocess-exited-with -error. --pystan installation

!!error: subprocess-exited-with-error python setup.py bdist_wheel did not run successfully. note: This error originates from a subprocess, and is likely not a problem with pip. error: legacy-install-failure Encountered error while trying to install…