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
4
votes
1 answer

pymc with observations on multiple variables

I'm using an example of linear regression from bayesian methods for hackers but having trouble expanding it to my usage. I have observations on a random variable, an assumed distribution on that random variable, and finally another assumed…
Andrew W
  • 43
  • 4
4
votes
3 answers

Installation issues with PyMC3

I was installing PyMC3 via Anaconda. The transaction execution was done. Post this action, my Anaconda console closes immediately on open. Unable to import PyMC3 module as well. Below is the error message that pops up before the console closes. I…
Naive_Natural2511
  • 687
  • 2
  • 8
  • 20
4
votes
1 answer

Running a multivariate ordered logit in PyMC3

I'm trying to build a Bayesian multivariate ordered logit model using PyMC3. I have gotten a toy multivariate logit model working based on the examples in this book. I've also gotten an ordered logistic regression model running based on the example…
Maya
  • 41
  • 3
4
votes
0 answers

Struggling to implement an extremely basic (3 categorical variables) Bayesian network using PYMC3

I'm trying to set up a simplified version of the Bayesian network here with only 3 categorical variables, and then do inference on that. The idea is that D3 is a child of D1 and D2, I'm setting D3=0, and then seeing what that suggestion about the…
JohnDoeVsJoeSchmoe
  • 671
  • 2
  • 8
  • 25
4
votes
1 answer

How are pymc3 variables assigned to the currently active model?

In PyMC3 you can do this basic_model = pm.Model() with basic_model: # Priors for unknown model parameters alpha = pm.Normal('alpha', mu=0, sd=10) beta = pm.Normal('beta', mu=0, sd=10, shape=2) sigma = pm.HalfNormal('sigma', sd=1) …
redacted
  • 3,789
  • 6
  • 25
  • 38
4
votes
1 answer

Metropolis Sampling

I'm working through a book called Bayesian Analysis in Python. The book focuses heavily on the package PyMC3 but is a little vague on the theory behind it so I'm quite confused. Say I have data like this: data = np.array([51.06, 55.12, 53.73, 50.24,…
RSHAP
  • 2,337
  • 3
  • 28
  • 39
4
votes
1 answer

PyMC3 traceplot not displaying

I am trying to get the PyMC3 examples from Osvaldo Martin's Bayesian Analysis with Python working. On Windows 10, while the following code using matplotlib works fine (i.e. a chart is displayed): import numpy as np import matplotlib.pyplot as…
Matti Wens
  • 740
  • 6
  • 24
4
votes
1 answer

Change Prior Pymc3 with from_formula

I'm working on a dataset from Kaggle (the one on Human ressources) I am trying to implement some bayesian statistics (logistic regression) but I don't understand how to change the prior on this model (I want the intercept to be an uninformative…
glouis
  • 541
  • 1
  • 7
  • 22
4
votes
1 answer

Can't disable messages for pymc3.find_MAP()

Sorry for the dumb question but I am unable to find any way to disable messages for pymc3.find_MAP(). As someone new to PyMC3 I think I've just learned to use the syntax properly (shakily) to do a single MAP estimate, given prior and likelihood…
Karl Young
  • 103
  • 5
4
votes
1 answer

pymc3 multiple gaussian process regression

I am trying to run a gaussian process regression with two features by extending the first example in https://pymc-devs.github.io/pymc3/notebooks/GP-introduction.html n = 20 X = np.array([list(a) for a in zip(np.sort(3*np.random.rand(n)),…
kosnik
  • 2,342
  • 10
  • 23
4
votes
1 answer

What is pm.Normal.dist.logp?

I'm reading Probabilistic Programming and Bayesian Methods for Hackers. In Ch5, it is written that logp = pm.Normal.dist(mu=price_estimate, sd=(3e3)).logp(true_price). What is this? I know pm.Normal() but don't know .dist() and .logp().
user4550164
4
votes
1 answer

Incorporating uncertainty into a pymc3 model

I have a set of data for which I have the mean, standard deviation and number of observations for each point (i.e., I have knowledge regarding the accuracy of the measure). In a traditional pymc3 model where I look only at the means, I may do…
Brad
  • 117
  • 9
4
votes
1 answer

How to fit data exhibiting skew in pymc3

I'm fitting a hierarchical model to some data, the fit appears to converge acceptably. with pm.Model() as model: mu_a = pm.Normal('mu_a', 0, sd=.2) sigma_b = pm.HalfNormal('sig_a', 0.1) mean = pm.Normal('mean', mu_a, sigma_b, shape=n) …
Darren Brien
  • 115
  • 7
4
votes
1 answer

CAR model from pymc2 to PyMC3

I'm still a noob in PyMC3, so the question might me naive, but I don't know how to translate this pymc2 code in pymc3. In particular it's not clear to me how to translate the R function. beta = pymc.Normal('beta', mu=0, tau=1.0e-4) s =…
marcodena
  • 550
  • 2
  • 5
  • 15
4
votes
1 answer

Simple Bayesian Network via Monte Carlo Markov Chain ported to PyMC3

I was porting the example of a Simple Bayesian Network via Monte Carlo Markov Chain from PyMC2 to PyMC3 and it works. The result can be found in the following gist on GitHub in the file pymc3_rain_sprinkler_grass_simple_bayesian_network.py. I…
cs224
  • 328
  • 2
  • 12