Questions tagged [pymc]

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

Filter by
Sorted by
Tagged with
1 vote
1 answer
512 views

Marginalising over standard deviation of normal to get the posterior on mean

I am trying to understand the concepts of Bayesian data analysis by examples. I have managed to "do" something, and I would like some advise on where I have gone wrong. My data is that I have 50 ...
Greg's user avatar
  • 474
10 votes
3 answers
8k views

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 ...
user2304916's user avatar
11 votes
1 answer
1k views

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 ...
Amelio Vazquez-Reina's user avatar
6 votes
1 answer
6k views

Latent Dirichlet Allocation in PyMC

As an exercise to improve my skills in PyMC (Python's Markov chain Monte Carlo library), I am trying to implement Latent Dirichlet Allocation as described here: https://en.wikipedia.org/wiki/...
Folgert Karsdorp's user avatar
4 votes
0 answers
917 views

Modeling a Correlated Bivariate Beta Distributions in PyMC3

My goal is to perform a bayesian A/B test of probabilities of success in two groups considering a hypothesis about non-zero covariance between those probabilities. Bivariate beta distribution I am ...
Valery Kustov's user avatar
13 votes
2 answers
10k views

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 ...
JPN's user avatar
  • 826
12 votes
2 answers
6k views

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 (...
mat kelcey's user avatar
9 votes
1 answer
6k views

Advice on sensitivity analysis for priors in Bayesian statistics

I'm not clear on how to perform sensitivity analysis on the priors. Many sites have different answers. One site indicates to perform three non-informative, weakly informative and known priors. Another ...
user3460430's user avatar
9 votes
2 answers
2k views

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 ...
Olivier_s_j's user avatar
  • 1,185
8 votes
2 answers
2k views

Regression Mixture in PYMC3

I'm attempting a problem where I have a mixture of regression coefficients. Not sure if my math or my coding is bad, but I'm getting wrong estimates for the coefficients, which should be 5 and -5. I ...
degenerate hessian's user avatar
8 votes
1 answer
2k views

PyMC3 implementation of Bayesian MMM: poor posterior inference

Google released a whitepaper on Media Mix Modelling (MMM) in 2017; vanilla MMM (established in the 1960s) uses multivariate regression. It's a decent mechanism to understand which of your marketing ...
jbuddy_13's user avatar
  • 2,501
7 votes
2 answers
2k views

Bayes-factor for testing a null-hypothesis?

I heard somewhere, that I can directly test (or gather support for) a null-hypothesis using the Bayes-Factor. In my specific experiment, I hypothesize that an experimental manipulation does not have ...
thias's user avatar
  • 965
6 votes
2 answers
4k views

Optimize starting parameters for Bayesian Linear Regression?

I'm using PyMC3 in Python 3 and I'm not sure exactly how to optimize my starting parameters. The example uses the regression ...
O.rka's user avatar
  • 1,442
5 votes
1 answer
2k views

PyMC3; create simple Linear Regression model with real-world datasets

The Linear Model I understand the concepts of Bayesian Inference in that the observed data, $x$, is fixed, and the parameters, $\theta$, are the random variables that follow a particular distribution....
O.rka's user avatar
  • 1,442
4 votes
0 answers
2k views

Is this correct hierarchical Bernoulli model?

I have a question about correctness of a model that I used for a fairly simple experiment. I'm not sure if it should go to stackoverflow or crossvalidated, because I feel like my question is both ...
Dmitry Smirnov's user avatar
3 votes
1 answer
2k views

Understanding the role of document size parameters in Latent Dirichlet Allocation

I am writing a pymc3-based implementation of Latent Dirichlet Allocation, and am referencing this CrossValidated answer (modified for pymc3) as well as pymc3's own tutorial on LDA, in addition to the ...
ely's user avatar
  • 2,312
3 votes
1 answer
1k views

How to find the Likelihood Function in a Bayesian Model given some Data

How should I find the likelihood function of a Bayesian Model? For example, if I'm given a coin, I can use the Bernoulli Distribution as the likelihood function (because I know in advance that the ...
Thiago's user avatar
  • 389
3 votes
1 answer
265 views

Probabilistic modelling MCMC question with pyMC

This is my first post and I am a newby in pymc. I am trying to model a non-linear system (see below for a further explanation). I create my synthetic data with: ...
Ramon Crehuet's user avatar
2 votes
0 answers
77 views

How to Build a Model with Correlation / Statistical Dependency for Bayesian A / B Testing

I use the Beta Binomial model for A/B testing. I wonder if there a way to build a model in PyMC which models correlation between the conversion rate of group A with ...
Mark's user avatar
  • 277
2 votes
2 answers
2k views

Good non-informative priors for estimating the parameters of a Gaussian with MCMC (using PyMC)?

Say I want to estimate the mean $\mu \in [0, 10] $ of some Gaussian data $\mathbf{x}$ with known variance $\sigma^2 = 1$ using MCMC. Usually I'd use a prior like $\mu \sim \mathrm{Uniform}(0, 10)$ and ...
roger_'s user avatar
  • 381
2 votes
2 answers
774 views

Bayesian Modeling: Yes, No and Maybe Responses

Respondents replied in the following way: Yes: they will be attending No: they won't be attending Maybe: they attach a percentage certainty as an estimate that they'll be attending. E.g. 40% sure ...
user avatar
2 votes
1 answer
157 views

Analytical formulation of a Hierarhical Bayes problem

In the free online book Bayesian Methods for Hackers, the last figure shows the estimation of the expected value of $\lambda$ for any given day: It looks like the author is calculating the expected ...
Amelio Vazquez-Reina's user avatar
2 votes
1 answer
164 views

Inconsistent posterior estimates in Beta-Binomial likelihood vs Binomial in Bayesian, multilevel models?

In this Google Colab, I've simulated Binomial count data and compared the performance of Binomial-likelihood and Beta-Binomial-likelihood models. Both models have the same Beta prior on theta, the ...
jbuddy_13's user avatar
  • 2,501
1 vote
1 answer
1k views

Fitting logistic function with pymc

I've asked this question on stackoverflow too, but no answer yet. This seems a more appropariate place to ask this question: I'm messing around with pymc to understand it a bit better. Now I am ...
Olivier_s_j's user avatar
  • 1,185
1 vote
0 answers
1k views

Lift in Bayesian A/B-test with pyMC

I'm implementing an A/B-test in pyMC to determine which of two groups to bet on in terms of pageviews per uniqe user. Working code, but I would love some feedback ...
cowboyvspirate's user avatar
1 vote
1 answer
1k views

Binomial Distribution Where N is Generated by a Poisson Process (pymc)

I'm not sure if this is the best way to go about this, because I'm fairly new to Bayesian methods. I'm trying to model a process where the number of trials $n$ used in a binomial process is generated ...
user3704120's user avatar
1 vote
1 answer
150 views

detect line in geocoordinates

I have repeated samples of geocoordinates of activities in a city. In most of these samples positions will simply be random. In some samples, however, some percentage of the data will be arranged -- ...
RoyalTS's user avatar
  • 233