Episode #125 of the Stack Overflow podcast is here. We talk Tilde Club and mechanical keyboards. Listen now

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
1answer
23 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
24 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
25 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
10 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
20 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
33 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
30 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}{\...
2
votes
1answer
63 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
51 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 $...
2
votes
0answers
27 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
66 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
52 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 ...
0
votes
0answers
170 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
0answers
33 views

Bayesian Model Validation in BEST

I am trying to perform BEST using pymc3 for finding difference between 2 groups of values (values from same group before and after). After performing similar analysis as shown in the link, I see no ...
0
votes
0answers
211 views

Bayesian network with continuous variable data set in python

I am looking to predict continuous target lets say Sales with KPIs like price distribution using Bayesian network. I have got it done with BNlearn in R but still ...
0
votes
1answer
139 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
282 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
169 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
229 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
270 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
79 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
217 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
47 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
44 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
45 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
81 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
82 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
36 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
87 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
212 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
65 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 ...
2
votes
1answer
246 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
171 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
411 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 ...
7
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
234 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 ...
10
votes
2answers
833 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
201 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
849 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
65 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
49 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
281 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
245 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
49 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,...
2
votes
1answer
102 views

Bayesian modeling of 2x2 factorial design. Am I doing it right?

I have a 2x2 factorial design with factors task (a, b) and stimulus type (c, d). I'm looking at behavioral data and was wondering how to test the main effect of task. To be more specific, I want to ...
-1
votes
1answer
529 views

Bayesian Neural Network in timeseries [closed]

I am currently exploring Bayesian Neural Network application on timeseries and stumbled on pymc3 library. But don't exactly understand how can I use it on a timeseries data. I am coming from a ...
1
vote
0answers
43 views

Understanding covariance in Bayesian regression model

I am confused about when to model covariance in a Bayesian regression. Here's what I am trying to model. I have a dataset which has scores for a set of students who did a set of practice exam problems....
2
votes
0answers
50 views

How to model 100% success probability for one group only in multi-factor model with a Bernoulli variable?

I am currently trying to do a Bayesian analysis of a data set from an experiment I conducted. The setup was something like this: Five participants Three tests, where each test is whether there is a ...
1
vote
2answers
635 views

Modelling time-dependent rate using Bayesian statistics (pymc3)

How to model time-dependent variables explicitly? (or alternatively, a better approach to modelling) I measure events over time and there are two sources: a) constant rate baseline and b) a time-...