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
6
votes
3 answers

Porting pyMC2 Bayesian A/B testing example to pyMC3

I am working to learn pyMC 3 and having some trouble. Since there are limited tutorials for pyMC3 I am working from Bayesian Methods for Hackers. I'm trying to port the pyMC 2 code to pyMC 3 in the Bayesian A/B testing example, with no success. From…
Eoin
  • 63
  • 3
6
votes
1 answer

Regression using PYMC3

I posted a IPython notebook here http://nbviewer.ipython.org/gist/dartdog/9008026 And I worked through both standard Statsmodels OLS and then similar with PYMC3 with the data provided via Pandas, that part works great by the way. I can't see how to…
dartdog
  • 10,432
  • 21
  • 72
  • 121
5
votes
1 answer

How to do simple survival analysis with pymc3 (Weibull distribution regression)?

I'm new to using pymc3, I've read Bayesian Methods for Hackers and done my best to work through existing survival analysis tutorials in pymc3. However, I don't understand how to write/interpret the "survival function". For this problem, I've…
Noah
  • 51
  • 1
5
votes
0 answers

Incremental Bayesian updates with multi-dimensional parameters

I am trying to use PYMC3 for a Bayesian model where I would like to repeatedly train my model on new unseen data. I am thinking I would need to update the priors with the posterior of the previously trained model every time I see the data, similar…
SinByCos
  • 613
  • 1
  • 10
  • 22
5
votes
4 answers

concat() got an unexpected keyword argument 'join_axes'

I am trying to use pymc3 in an ipynb on Google Colab. Here is my code: regression_conjugate = pm.Model() with regression_conjugate: sigma2 = pm.InverseGamma("sigma2",alpha = 0.5*nu0,beta=0.5*lam0) sigma = pm.math.sqrt(sigma2) a =…
渡邊彰久
  • 51
  • 1
  • 1
  • 2
5
votes
1 answer

Why is Pymc3 ADVI worse than MCMC in this logistic regression example?

I am aware of the mathematical differences between ADVI/MCMC, but I am trying to understand the practical implications of using one or the other. I am running a very simple logistic regressione example on data I created in this way: import pandas as…
Alberto
  • 467
  • 3
  • 16
5
votes
1 answer

pymc3 : Dirichlet with multidimensional concentration factor

I am struggling with implementing a model where the concentration factor of the Dirichlet variable is dependent on another variable. The situation is the following: A system fails due to faulty components (there are three components, only one fails…
Hugo
  • 53
  • 4
5
votes
1 answer

PYMC3 ValueError: Mass matrix contains zeros on the diagonal. Some derivatives might always be zero

I am getting this error while using PYMC3 for calculating posteriors: with pm.Model() as model: p = pm.Gamma('p', alpha=1, beta=3, shape=regions.shape[0]) q = pm.Gamma('q', alpha=1, beta=3, shape=regions.shape[0]) m = pm.Lognormal('m',…
5
votes
1 answer

Solving ODEs in PYMC3

Here I aim to estimate the parameters (gama and omega) of a damped harmonic oscillator given by dX^2/dt^2+gamma*dX/dt+(2*pi*omega)^2*X=0. (We can add white gaussian noise to the system.) import pymc import numpy as np import scipy.io as…
5
votes
1 answer

PyMC3 Gaussian Mixing Model

I've been following the Gaussian mixture model example for PyMC3 here: https://github.com/pymc-devs/pymc3/blob/master/pymc3/examples/gaussian_mixture_model.ipynb and have got it working nicely with an artificial dataset. I've tried it with a real…
Anjum Sayed
  • 872
  • 9
  • 20
5
votes
0 answers

How to benefit from GPU with PYMC3

I see zero difference in PYMC3 speed when using GPU vs. CPU. I am fitting a model that requires 500K+ samples to converge. Obviously it is very slow, so I tried to speed things up with GPU (using GPU instance on EC2). Theano reports to be using GPU,…
volodymyr
  • 7,256
  • 3
  • 42
  • 45
5
votes
1 answer

Rewriting a pymc script for parameter estimation in dynamical systems in pymc3

I'd like to use pymc3 to estimate unknown parameters and states in a Hodgkin Huxley neuron model. My code in pymc is based off of…
5
votes
1 answer

accessing value of a random variable in PyMC3

In PyMC2, there are methods random() and value() to generate a random value, and get the current value of random variables. Is there any way to do the same in PyMC3? p = pm.Dirichlet('p', theta=np.array([1., 1., 1.])) p.random() p.value
ahmethungari
  • 2,089
  • 4
  • 19
  • 21
5
votes
1 answer

Sampling from user provided target densities in PyMC3

Is it possible to sample from a user provided target measure in PyMC3 in an easy way? I.e. I want to be able to provide black box functions logposterior(theta) and grad_logposterior(theta) that and sample from those instead of specifying a model in…
devnull
  • 147
  • 1
  • 5
5
votes
1 answer

Using the pymc3 likelihood/posterior outside of pymc3: how?

For comparison purposes, I want to utilize the posterior density function outside of PyMC3. For my research project, I want to find out how well PyMC3 is performing compared to my own custom made code. As such, I need to compare it to our own…
Rutger
  • 121
  • 6
1 2
3
47 48