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
2
votes
1answer
37 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
40 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 $...
0
votes
0answers
18 views

Hierachical Bayesian Linear Regression using PyMC3 is super slow [migrated]

I am trying to write some code for implementing HBM in the case of logistic regression using the adults dataset from the UCI repository. I have already written the code, but sampling is super slow, ...
2
votes
0answers
22 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
47 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
41 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
105 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
27 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
161 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
93 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
152 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
122 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
110 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
200 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
66 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
142 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
46 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
31 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
94 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
67 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
73 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
35 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
79 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
57 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
179 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
55 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
194 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
131 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
351 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
186 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
795 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
166 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
768 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
44 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
247 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
225 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
97 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
446 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
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
538 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
1k 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
69 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
163 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)$...