Questions tagged [pymc3]

PyMC (formerly PyMC3) is a Python module that implements Bayesian statistical models and fitting algorithms, including Markov chain Monte Carlo. Its flexibility and extensibility make it applicable to a large suite of problems. Along with core sampling functionality, PyMC includes methods for summarizing output, plotting, goodness-of-fit and convergence diagnostics.

PyMC is a Python module that implements Bayesian statistical models and fitting algorithms, including Markov chain Monte Carlo.

Its flexibility and extensibility make it applicable to a large suite of problems. Along with core sampling functionality, PyMC includes methods for summarizing output, plotting, goodness-of-fit and convergence diagnostics.

706 questions
0
votes
0 answers

PyMC3 Conditioning Random Variable on Multiple Discrete Parents

I recently started doing probabilistic programming using PyMC3. In my scenario, I have 3 random variables: On, Triangle, and X, such that X depends on Triangle and On. Triangle and On both follow Bernoulli distributions, and depending on which value…
myselfesteem
  • 733
  • 1
  • 6
  • 23
0
votes
1 answer

Installing PyMC3 on Anaconda 3 / Win

This installation is a nightmare!!! Using: conda install -c conda-forge pymc3 Will not work. I then tried to install theano first (and its dependencies), found out the hard way that it works with python=3.5, NOT 3.6. # Install theano…
user1581390
  • 1,900
  • 5
  • 25
  • 38
0
votes
1 answer

Unable to install PyMc3 on Msys2

I'm running Msys2 on Windows 10. I have Python 3.6 installed under with mingw-w64 as well as mingw-i686. I have the gcc tool chain for Msys, mingw-w64, and mingw-i686. I tried to install PyMc3 using pip3. The installation failed with the following…
sreedta
  • 123
  • 1
  • 9
0
votes
1 answer

Influence diagrams / Decision models in Stan and PyMC3

Is it possible to write decision-making models in either Stan or PyMC3? By that I mean: we define not only the distribution of random variables, but also the definition of decision and utility variables, and determine the decisions maximizing…
0
votes
1 answer

Estimating the p value of the difference between two proportions using statsmodels and PyMC3 (MCMC simulation) in Python

In Probabilistic-Programming-and-Bayesian-Methods-for-Hackers, a method is proposed to compute the p value that two proportions are different. (You can find the jupyter notebook here containing the entire…
user8270077
  • 4,621
  • 17
  • 75
  • 140
0
votes
0 answers

Resetting Theano graph

I need to run a PyMC3 model in a loop to estimate/make predictions every month. How do you reset the Theano graph? I'm familiar with Tensorflow and I know this can be done, but googling doesn't seem to lead to any solutions. Alternatively, how are…
swmfg
  • 1,279
  • 1
  • 10
  • 18
0
votes
1 answer

pymc3 negative binomial regression interpretation of mu and alpha

I am confused about the interpretation for the negative binomial regression with python pymc3 package. I am not sure how to interpret the mu and alpha in GLM. Here I have a simple vector, and I want to find the NB regression model for itself: # The…
kikyo91
  • 37
  • 1
  • 8
0
votes
0 answers

Why isn’t NUTS sampling with tt.dot or pm.math.dot?

I am trying to implement parts of Facebook's prophet with some help from this example. https://github.com/luke14free/pm-prophet/blob/master/pmprophet/model.py This goes well :), but I am having some problems with the dot product I don't understand.…
ritchie46
  • 10,405
  • 1
  • 24
  • 43
0
votes
1 answer

Using Categorical with multi-dimensional p in PyMC3

I am running into problems when I am trying to use pm.Categorical to sample many instances at once (either with multidimensional p or using theano.scan). What is the best way to go here? My goal is to sample one response per draw for each of many…
Maria
  • 108
  • 1
  • 6
0
votes
1 answer

Metropolis-specific TypeError: The broadcastable pattern of the input is incorrect for this op

I am trying to build a multilevel, multidimensional Bayesian model in PyMC3. For this question, I'll use a smaller toy model with the following graph structure: where G represents genes, K cell types, and C_k cells of cell type k. Overall the…
merv
  • 67,214
  • 13
  • 180
  • 245
0
votes
1 answer

Using theano.scan within PyMC3 gives TypeError: slice indices must be integers or None or have an __index__ method

I would like to to use theano.scan within pymc3. I run into problems when I add more than two variables as sequences. Here is a simple example: import numpy as np import pymc3 as pm import theano import theano.tensor as T a = np.ones(5) b =…
Maria
  • 108
  • 1
  • 6
0
votes
1 answer

pymc3 multinomial mixture gets stuck

I am trying use PYMC3 to implement an example where the data comes from a mixture of multinomials. The goal is to infer the underlying state_prob vector (see below). The code runs, but the Metropolis sampler gets stuck at the initial state_prior…
Antony Joseph
  • 255
  • 2
  • 7
0
votes
1 answer

Bayesian Inference with PyMC3. Compilation error.

The following two codes do a simple bayesian inference in python using PyMC3. While the first code for exponential model compiles and run perfectly fine, the second one for a simple ode model, gives an error. I do not understand why one is working…
0
votes
1 answer

PyMC3 autocorrplot() for any given array

The autocorrplot() function gives the autocorrelation plot for the sampled data from the trace. If I already have a sample of data in the form of an array or list, can I use autocorrplot() to do the same? Is there any alternative to generate…
0
votes
1 answer

Using pymc3 to fit lomax model

I have a pretty simple example that doesn't seem to work. My goal is to build a Lomax model, and since PyMC3 doesn't have a Lomax distribution I use the fact that an Exponential mixed with a Gamma is a Lomax (see here): import pymc3 as pm from…
Nick Resnick
  • 591
  • 1
  • 5
  • 14