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
0
votes
0answers
22 views

Modelling a race

If we imagine an outdoor race with two obstacles: If the participant fails an obstacle attempt they exit the race Historical data shows that about 50% of participants will fail each obstacle That ...
0
votes
1answer
20 views

Forecast survey response rate

I am new to Bayesian forecasting and hope you can help me get started with this problem: I need to forecast the likely survey response rate to a paid-for survey Background information: Each person ...
0
votes
0answers
13 views

Bayesian Linear Regression: pyMC3 vs. analytical solution

I was re-poducing the plots by Bishop 2006 p.155 and thought it might be interesting to compare both, the analytical solution provided by Bishop and an approximated MCMC soultion with ...
0
votes
1answer
29 views

Using Co-variates in Item Response Theory 3PL model?

I am using Item Response theory(IRT) using 3 Parameter Logistic Model(3PL) for Logic test. After training the model, I use the posterior means of the item parameters 𝛼, β and γ to estimate person ...
0
votes
0answers
6 views

How to interpret variance of hyper parameters in Bayesian Linear/Logistic Regression

I'm building some models in PYMC for linear and logistic regression and placing priors over the parameters of the coefficients' distributions, e.g. model below. I've noticed that often the ...
0
votes
1answer
43 views

PyMC's treatment of shape versus deterministic data, when a random variable's parameter is vector-valued

I'm working on a problem with PyMC3 that makes me think I need to better understand how it deals with random variables whose parameters are vector-valued. Data description and problem setup I have $...
1
vote
0answers
227 views

Modeling 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 ...
1
vote
1answer
41 views

Bayesian liability threshold model

Let $\bf{y}$ denote a vector of binary data, such as whether a group of individuals suffer from a particular disease, and let $\bf{X}$ denote a matrix of potential predictors, including an intercept ...
1
vote
0answers
45 views

Using information involving multiple model parameters as a prior

I am estimating a relatively simple linear equation of the following form: $$ y = \beta_0 + \beta_1p + \beta_2t +\epsilon $$ I would like to take a bayesian modelling approach, and have existing ...
0
votes
0answers
28 views

bayesian estimation of difference between 2 non-normal groups

Lets say we have 2 sets of groups with random variable X as shown. Features of X based on real dataset: They are all positive numbers have really long right tail and almost no left tail Cant share ...
0
votes
0answers
28 views

Why Are they doing exponential distributions?

With many thanks for help in why my exercise is using a Gamma distribution, I am still confused by another part. The plot: The commentary: We may suspect from the above that there is some sort of ...
0
votes
0answers
21 views

Softmax Linear Regression/ Multinomial Logistic Regression with shared coefficients and different inputs

I am trying to build a Softmax Regression model for 3 classes, where, unlike what is usually done, the coefficients between different options are shared and what varies are the input variables. ...
0
votes
0answers
53 views

Modelling a random variable that is mostly zero, but otherwise exponential (PyMC3)

I'm new to probabilistic programming, and have run into problems of this kind a few times now. Simply put: I often find myself wanting to model a random variable that mostly has some nice, continuous ...
0
votes
1answer
59 views

pymc3: Updating the standard error prior

I am estimating a Bayesian multiple regression using continuous data on both the dependent variable and the regressors. My goal is to iteratively estimate the coefficient distributions as more data ...
1
vote
0answers
41 views

Implementation of an integral formula for an a posteriori estimate in pymc3

I am trying to fit a model according to some data. The data I have are supposed to obey the following formula: $$\mu_g(t) = (\mu_0 + \frac{\alpha_g}{\delta_g})\exp(-\delta_g t) + \frac{\alpha_g}{\...
3
votes
1answer
159 views

Observed deterministic variables in MCMC

I need to model a measurement of an "exponential decay" i.e. I have a histogram of counts $Y$ over an array of (time-) intervalls. I want to use MCMC to infer parameters ($A_1,\lambda_1,A_2,\lambda_2,\...
1
vote
0answers
70 views

Bayesian fitting with very noisy data

I am trying to fit a response curve through noisy data. The curve is supposed to model a saturating return, which takes the analytical form: $$ x \to y(x) = \alpha( 1- e^{-\frac{x}{\beta}})$$ where $...
3
votes
0answers
39 views

Bayesian Survival function

I have managed to estimate the posterior of the latent variables of my model which can be stated as follows (adapted from https://docs.pymc.io/notebooks/bayes_param_survival_pymc3.html): \begin{align} ...
6
votes
0answers
97 views

Robust Gamma Regression

I am modeling some spectroscopic data where the response of the instrument to the size of the input is strictly positive and non-linear. Gamma regression seems like a good choice to explain the data, ...
0
votes
0answers
65 views

How to assess uncertainty in a Bayesian analysis?

I'm building a model to estimate recurrence of flood magnitudes via fitting a GEV distribution to flow data. The aim of the study is to compare stationary and non stationary models using a Bayesian ...
1
vote
2answers
226 views

A hierarchical Bayesian model in pymc3

Suppose we have the following model: $X$ unobserved $Y$ such that $Y|X \sim \mathcal{N}(X,\sigma^2)$, observed $Z$ such that $Z|X \sim \mathcal{B}(1,X)$, observed and suppose, given observed data $...
0
votes
1answer
194 views

PyMC3: up-to-date implementation of Price is Right example?

So, getting into PyMC3 a lot more and working through examples, I found I cannot implement in an up-to-date form an example from Cameron Davidson-Pilon's Bayesian ...
0
votes
1answer
519 views

pymc3: acceptance probabilities and divergencies after tuning

I coded two models in pymc3, which I thought are quite simple. Logistic Regression The first is a logistic regression in an experiment that models correct and wrong answers for specific tasks in a ...
2
votes
0answers
208 views

Posterior sampling without using pm.Potential in pyMC3

I'm going through the Price Is Right example in chapter 5 of Probabilistic Programming & Bayesian Methods for Hackers and I have problems understanding the solution. I have tried to change the ...
3
votes
1answer
373 views

Finding the Poisson rate parameter with PyMC3

I'm trying to compute the rate parameter of fake set of poisson data, where I set the parameter. When I run PyMC the posterior distribution always peaks around the true rate parameter, but never ...
0
votes
1answer
306 views

PyMC3: Mixture Model with Latent Variables

I have a rather basic knowledge of Bayesian inference and I'm somewhat new to MCMC and PyMC3. Can I model data that looks like this? ...
2
votes
0answers
92 views

How to interpret forestplot with pymc on standard devisions of two groups

I'm using pyMC3 to do Bayesian estimation supersedes the t test (BEST) and I was wondering how to actually interpret this result. I see both groups have significantly different stds because the bar ...
1
vote
1answer
307 views

Why can't I use a Bernoulli as a likelihood variable in a hierarchical model in PyMC3?

This is essentially the "Multiple Coins from Multiple Mints / Baseball Players" example from Doing Bayesian Data Analysis, Second Edition (DBDA2). I believe I have PyMC3 code which is functionally ...
2
votes
1answer
48 views

Is it always a requirement to declare a distribution model first before applying MCMC models/bayesian analysis?

I've read lot of articles that is using pymc python module to apply MCMC algorithms into solving real life problems. I found that all the examples are about to assume various kinds of distribution ...
1
vote
0answers
54 views

What would be a good sampler from pymc3 for highly skewed data

I have a gamma distributed data which is highly skewed - alpha=0.15, beta=0.001. I would like to perform mcmc to find the delta between two gamma distributions. I get the following error: I suspect ...
4
votes
1answer
50 views

Appropriate Distribution for Survival Probability Parameters

I have a model that assumes a probability of survival over discrete time (example: decades) ...
2
votes
1answer
98 views

Distorted hyperpriors when sampling from the prior only

I am currently testing some multilevel models in pymc3 and found that the hyperpriors get distorted when I run the level only to generate the prior. The hyperpriors I am using are generating ...
4
votes
1answer
116 views

Modelling Time Series of Ratios

I’m having difficulties dealing with a time series of relations between two numbers. I have two time series, essentially a count of "successes" and "trials". What I'm interested in, though, is the ...
1
vote
0answers
37 views

HOW TO - Applying MCMC to conditionally select random variables?

I am quite new to the using Graphical Models, so pardon me for the naivety. My intention is to have some fun for the weekend and impress my friends on Monday. I am trying to understand MCMC and ...
1
vote
1answer
96 views

Question about port of R code from the library “rethinking” to PyMC3

A very generous human named Osvaldo Martin did us the favor of porting all the R sample code in Richard McElreath's superb book Statistical Rethinking to PyMC3. I'm hugely grateful, but I've already ...
1
vote
0answers
285 views

LDA implementaion in pymc3

I am implementing LDA with pymc3 using the referred code for pymc from the post Latent Dirichlet Allocation in PyMC I am trying to use it for pymc3 bt having problems defining ...
1
vote
1answer
74 views

Advice on choosing a likelihood distribution for data in logaritmic units

I have a Bayesian model to fit a set of parameters given some observables (flux from astronomical objects). Since many users will prefer to define the priors using logarithmic units and I could remove ...
3
votes
1answer
322 views

Plate notation for a hierarchical regression model (bayesian)

I've been recently studying hierarchical bayesian regressio (with pymc3), and I was wondering, how does the following example: http://twiecki.github.io/blog/2014/03/17/bayesian-glms-3/ look like ...
3
votes
1answer
213 views

Forecasting intermittent demand with PyMC3

I'm trying to implement a model in PyMC3 which relies on a switch with a stochastic condition in the final step, and hence can't pass observed values to the model. Question. What is the "correct" ...
3
votes
1answer
593 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 ...
8
votes
2answers
1k views

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 ...
0
votes
1answer
271 views

How to interpret posterior distribution plots for multiple priors? [closed]

Let us consider the following Bayesian model: $f(x|\mu, \theta)$ the observation model, $\pi(\mu, \theta)$ the joint prior distribution, $\pi(\mu, \theta|x)$ the posterior distribution. It is ...
11
votes
2answers
914 views

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 ...
1
vote
1answer
261 views

sampling behind bayesian hierarchical models

I'm unsure how sampling is done in Bayesian Hierarchical modelling, i'm reading a book on how to use it in PyMC3 but it doesn't explain the math and i'd like to understand it. Suppose i want to ...
1
vote
1answer
953 views

Posterior Predictive Check (PPC) for a Bayesian linear regression model: Edward's result is pretty different from PyMC3's?

I'm trying to build a simple Bayesian regression model to test Edward. However, I notice significant different between Edward's PPC results and PyMC3's. Common code to generate a data set. ...
0
votes
1answer
69 views

Bayesian Modeling Understanding 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. Say I'm looking at a model like this My ...
0
votes
0answers
64 views

Hierarchal Bayes: logistic regression

We have the following model that was proposed to me. It takes yes, no and maybe responses to try and predict attendance $y_{i}$. $$ \begin{align} y_i &\sim \mathsf{Bin}(n, p_i) \\ p_i &= \...
1
vote
1answer
312 views

Using PyMC3, how could I force a maximum to posterior distribution?

I am pretty new to bayesian statistics and PyMC3. I am doing a hierarchical model where the output variable I am trying to predict is a percentage with a maximum of 100%. My problem is that my ...
1
vote
2answers
292 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 ...
0
votes
1answer
56 views

Estimate a parameter from subset of the data, other parameters from all data

I use Bayesian random effects models [$y_i \sim bernoulli\_logit(\beta + \alpha_{subj})$ $\alpha_{subj} \sim normal(0, \gamma)$], the $y$ outcome is binary. Part of the subjects have two observations,...

1 2 3 4 5