Questions tagged [pymc]
PyMC is a Python library for performing Bayesian inference using MCMC. It is a Python equivalent to JAGS and BUGS.
265 questions
6
votes
2
answers
178
views
What does skewed distribution as posterior mean?
I am trying to estimate the values of three unknown parameters in the Ordinary Differential Equation (ODE) using pyMC. Physically, A should be smaller than both B and C. But, given the data and ODE I ...
1
vote
1
answer
85
views
Pymc-BART Index error
I am trying to follow an example notebook from here but I am running into some IndexErrors when executing the code.
Here's a Minimal working example:
...
3
votes
2
answers
180
views
Fitting OLS with constraint on the betas [duplicate]
Suppose my model looks like $y=\beta_1x_1 + \beta_2x_2 + \beta_3x_3$, but there's a catch: I want to enforce $\beta_1=\beta_3$. How do I do this, in both frequentist and Bayesian setup? Specifically ...
0
votes
0
answers
47
views
PyMC model from aggregated data
I am starting with probabilistic programming and PyMC and seems that stuck with the first step. I am trying to figure out something very simple and then add complexity. Appreciate if you can help me ...
0
votes
0
answers
99
views
Negative Binomial GLM - Overflow in the link function
I am trying to create a GLM to model some count data.
I am using the pymc package in python.
The set up is what I believe to be the usual set up:
$$Y \sim NB(\mu,k) $$
$$E(Y\vert\mathbf{X}) = \mu $$
$$...
3
votes
1
answer
104
views
Estimating posterior of proportion of positives in population from per-observation probabilities
I have a sample from some population of 0s and 1s and need to estimate the posterior of the proportion of 1s in this population. But the catch is: for each observation in the sample I only have ...
2
votes
1
answer
625
views
Why do we need to scale the variables in a Bayesian model?
In a Bayesian MMM model using pymc3 the variables are scaled. It is said that scaling helps in improving the efficiency of the MCMC algorithm. Also, it is stated that setting priors for the non-scaled ...
2
votes
0
answers
38
views
Lots of variability in the effective sample size but stable parameter estimates?
I ran 4 chains with NUTS and made a forest plot, but I cannot show the plot here. In words, what I am seeing is the there is a lot of variability in the effective sample size (ESS) in the chains. ...
2
votes
0
answers
264
views
Bayesian meta-analysis: Why and how to weight individual study's contribution to overall effect?
I'm interested in performing a Bayesian meta-analysis, specifically, using a random-effects hierarchical model (as described here). Briefly, in this model we assume that the $k$th study's reported (...
1
vote
0
answers
147
views
A Bayesian marginal structural model (IPW) in a single model
Inspired by Richard McElreath's "Full Luxury Bayes" in his Statistical Rethinking course, I wanted to implement a "Full Luxury Bayesian Marginal Structural Model".
Briefly: MSMs ...
6
votes
1
answer
771
views
How to interpret rank bar plot of a MCMC trace?
I am learning how to use PyMC for Bayesian inference. I coded up a random intercept $Y = \gamma + \sum_{j=1}^3 \beta_j \mathbb{I}_j + \epsilon$ and looked at the trace plots. Here is a ...
3
votes
1
answer
861
views
Bayesian regression confidence intervals with Pymc3
This question is based on question 1 of the week 2 Statistical Rethinking problems, i.e. q1 here: https://github.com/rmcelreath/stat_rethinking_2022/blob/main/homework/week02.pdf
I have a pandas data ...
4
votes
2
answers
742
views
Reason behind only using internal knots when defining basis splines
In the spline regression tutorials of pymc and bambi they first define the knots using quantiles, but for building the design matrix they don't use the boundary knots and only keep the internal knots. ...
2
votes
1
answer
230
views
PyMC3 Beta-Binomial fails to converge on actual parameter values
Something is not performing as expected with PyMC. I'm trying a simple Beta-Binomial conjugate prior model, trying to recover known parameters.
Control data
...
0
votes
0
answers
95
views
Need help explaining Bayesian p-value plot
I'm working through Chapter 2 of BMCP and am having trouble understanding why the plot of a Bayesian p-value looks so unexpectedly "spiky" or multimodal. Here's my code
...