# Questions tagged [pymc]

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

27 questions
Filter by
Sorted by
Tagged with
1 vote
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 ...
• 474
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 ...
• 453
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 ...
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/...
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 ...
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 ...
• 826
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 (...
• 223
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 ...
• 177
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 ...
• 1,185
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 ...
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 ...
• 2,501
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 ...
• 965
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 ...
• 1,442
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....
• 1,442
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 ...
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 ...
• 2,312
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 ...
• 389
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: ...
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 ...
• 277
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 ...
• 381
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 ...
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 ...
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 ...
• 2,501
1 vote
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 ...
• 1,185
1 vote
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 ...
1 vote
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 ...
• 339
1 vote