Questions tagged [pymc]

PyMC is a Python library for performing Bayesian inference using MCMC. It is a Python equivalent to JAGS and BUGS.

PyMC is a Python library for performing Bayesian inference using MCMC. It is a Python equivalent to JAGS and BUGS.

Reference: PyMC: Bayesian Stochastic Modeling in Python

241 questions
21
votes
1 answer

Getting started with bayesian structural models using MCMC

I'm trying to learn bayesian structural time series analysis. For a variety of reasons I need to use Python (mostly pymc3) not R so please do not suggest the bsts R package. Moreover, I would like to gain a conceptual understanding not use a black…
Paul
  • 365
  • 2
  • 6
18
votes
1 answer

Bayesian network inference using pymc (Beginner's confusion)

I am currently taking the PGM course by Daphne Koller on Coursera. In that, we generally model a Bayesian Network as a cause and effect directed graph of the variables which are part of the observed data. But on PyMC tutorials and examples I…
zubinmehta
  • 283
  • 2
  • 7
15
votes
1 answer

COVID in Germany, LOO-CV for time series

The paper in Science [1] infers change points in COVID spread in Germany. The authors fit the number of daily cases assuming one (red), two (orange), and three (green) change points. Every change point adds two parameters to the model. It is hard…
13
votes
2 answers

PyMC beginner: how to actually sample from the fitted model

I'm trying a very simple model: fitting a Normal where I assume I know the precision, and I just want to find the mean. The code below seems to fit the Normal correctly. But after fitting, I want to sample from the model, ie generate new data which…
jmmcd
  • 363
  • 3
  • 9
12
votes
2 answers

Why are there recommendations against using Jeffreys or entropy based priors for MCMC samplers?

On their wiki page, the developers of Stan state: Some principles we don't like: invariance, Jeffreys, entropy Instead, I see a lot of normal distribution recommendation. So far I used Bayesian methods that didn't rely on sampling, and was kind of…
wirrbel
  • 565
  • 3
  • 15
12
votes
2 answers

What is pm.Potential in PyMC3?

I'm going through the Price Is Right example in chapter 5 of Probabilistic Programming & Bayesian Methods for Hackers. It reads: Example: Optimizing for the Showcase on The Price is Right Bless you if you are ever chosen as a contestant on the…
JPN
  • 746
  • 1
  • 6
  • 16
12
votes
1 answer

Bayesian modeling of train wait times: The model definition

This is my first attempt for somebody coming from the frequentist camp to do Bayesian data analysis. I read a number of tutorials and few chapters from Bayesian Data Analysis by A. Gelman. As the first more or less independent data analysis example…
Vladislavs Dovgalecs
  • 2,315
  • 15
  • 18
11
votes
1 answer

Outlier detection in beta distributions

Say I have a large sample of values in $[0,1]$. I would like to estimate the underlying $\text{Beta}(\alpha, \beta)$ distribution. The majority of the samples come from this assumed $\text{Beta}(\alpha, \beta)$ distribution, while the rest are…
Amelio Vazquez-Reina
  • 17,546
  • 26
  • 74
  • 110
11
votes
2 answers

Fitting model for two normal distributions in PyMC

Since I'm a software engineer trying to learn more stats you'll have to forgive me before I even start, this is serious newb territory... I've been learning PyMC and working through some really (really) simple examples. One problem I can't get to…
mat kelcey
  • 213
  • 2
  • 5
11
votes
1 answer

Bayesian model selection in PyMC3

I am using PyMC3 to run Bayesian models on my data. I am new to Bayesian modeling but according to some blogs posts, Wikipedia and QA from this site, it seems to be a valid approach to use Bayes factor and BIC criterion to be able to choose what…
hadim
  • 214
  • 2
  • 8
10
votes
2 answers

PyMC for nonparametric clustering: Dirichlet process to estimate Gaussian mixture's parameters fails to cluster

Problem setup One of the first toy problems I wanted to apply PyMC to is nonparametric clustering: given some data, model it as a Gaussian mixture, and learn the number of clusters and each cluster's mean and covariance. Most of what I know about…
Ahmed Fasih
  • 255
  • 2
  • 14
10
votes
2 answers

Probabilistic programming vs "traditional" ML

I was browsing the github repo for Pymc and found this notebook: Variational Inference: Bayesian Neural Networks The author extols the virtues of bayesian/probabilistic programming but then goes on to say: Unfortunately, when it comes to…
10
votes
3 answers

2-Gaussian mixture model inference with MCMC and PyMC

The problem I want fit the model parameters of a simple 2-Gaussian mixture population. Given all the hype around Bayesian methods I want to understand if for this problem Bayesian inference is a better tool that traditional fitting methods. So far…
9
votes
1 answer

Hierarchical Bayesian modeling of incidence rates

Kevin Murphy's book discusses a classical Hierarchical Bayesian problem (originally discussed in Johnson and Albert, 1999, p24): Suppose that we are trying to estimate the cancer rate in $N$ cities. In each city, we sample a number of individuals…
9
votes
2 answers

Switchpoint detection with probabilistic programming (pymc)

I'm currently reading the Probabilistic Programming and Bayesian Methods for Hackers "book". I've read a few chapters and I was thinking on the first Chapter where the first example with pymc consist of detecting a witchpoint in text messages. In…
Olivier_s_j
  • 1,055
  • 2
  • 11
  • 25
1
2 3
16 17