Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [pymc]

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

2
votes
0answers
21 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
43 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
38 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
70 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
23 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
110 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
73 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
110 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
90 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 ...
2
votes
1answer
71 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
158 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
52 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
123 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 ...
0
votes
0answers
21 views

how to create a bayesian model to combine different breakdowns/groups of people in a single population?

Let's assume we can represent a population in two different dimensions and we know the behaviour of the population if they are taking a specific action. Example; 1st dimension: breakdown population ...
2
votes
1answer
43 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
28 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 ...
1
vote
0answers
85 views

Plotting individual dimensions of posterior PYMC3 [closed]

I have used PYMC3 to perform inference on a Bayesian logistic regression model. I want to find the posterior over the weights $\beta \in \mathbb{R}^K$ given a Gaussian prior $\mathcal{N} \sim (0,100 \...
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
55 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
70 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
33 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
77 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 ...
0
votes
0answers
51 views

PyMC3 How does one make a model parameter dependent on independent variable?

I recently encounter such an interesting question. For example, if I have want to create a model using x to predict y. A part of ...
1
vote
0answers
165 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
53 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
175 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 ...
2
votes
1answer
115 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" ...
2
votes
1answer
309 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
962 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
0answers
45 views

Possible alteration of an existing pymc3 rugby model using additional data to add a bias towards the winning team

I have been applying [https://docs.pymc.io/notebooks/rugby_analytics.html][1] to my data. The problem is that I also have win/ lose probabilities from another model along with the home and away scores....
0
votes
1answer
178 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 ...
1
vote
0answers
2k views

What is No-U-Turn Sampler? [closed]

I am planning to use PyMC3 for my research.I understand the syntax but the problem is what No-U turn is really doing. Gellman paper says ...
10
votes
2answers
747 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
147 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
720 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
63 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
43 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 &= \...
0
votes
1answer
231 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
209 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
48 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
92 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 ...
0
votes
1answer
415 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
42 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
48 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
486 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-...
1
vote
1answer
942 views

Probability function from two random variables in PyMC3

I'm new to Bayesian and PyMC3 and I am trying to predict a chance of failure very similar to this example (the part example:Challenger Space Shuttle Disaster): http://nbviewer.jupyter.org/github/...
1
vote
0answers
67 views

Sampling MaxEnt Distribution with PyMC3

I’m trying to use PyMC3 to sample from a maximum entropy distribution over binary patterns of length $N$, constrained by means and pairwise correlations. The ...
0
votes
1answer
150 views

Bayesian model comparison using cross-validation when models are functions of different variables

I'm trying to compare the predictive power of different models (in PyMC3) using Leave-One-Out Cross-Validation. Most models are in the form $y = f(x)$, but one important model is in the form $x = g(y)$...
1
vote
0answers
25 views

“Blocking” effects in probabilistic programs

I'm trying to estimate a regression where: I can only see the sex of a subset of the population I do know the total population size I'd like to know how many events are driven my men vs women, using ...
2
votes
0answers
210 views

Formulating a hierarchical Bayesian model for gambling (Pymc3)

I am quite new to Bayesian modeling and trying to wrap my head around how to choose hyperpriors and formulate the model. I am using Pymc3 My example data is gambling related. People play a 'balloon' ...