r/BayesianProgramming • • Jul 19 '19

Model and parameter selection in Bayesian hierarchical models

Thumbnail
self.statistics
7 Upvotes

r/BayesianProgramming • • Jun 28 '19

A general-purpose probabilistic programming system with programmable inference

Thumbnail
github.com
7 Upvotes

r/BayesianProgramming • • Apr 29 '19

Probabilistic Modeling In Python (And What That Even Means)

Thumbnail
pythonpodcast.com
7 Upvotes

r/BayesianProgramming • • Apr 23 '19

Bambi Documentation — bambi 0.1.1 documentation

Thumbnail bambinos.github.io
7 Upvotes

r/BayesianProgramming • • Dec 11 '18

Hamiltonian Monte Carlo explained

Thumbnail
arogozhnikov.github.io
7 Upvotes

r/BayesianProgramming • • Aug 08 '18

Simplified version of the Facebook Prophet model re-implemented in PyMC3

Thumbnail
github.com
7 Upvotes

r/BayesianProgramming • • Jul 22 '18

Why I'm Excited about PyMC3 v3.5.0

Thumbnail colindcarroll.com
7 Upvotes

r/BayesianProgramming • • May 10 '18

Bayesian Optimal Pricing, Part 1

Thumbnail
cscherrer.github.io
7 Upvotes

r/BayesianProgramming • • Apr 19 '18

Release v3.4.1 Final · pymc-devs/pymc3

Thumbnail
github.com
7 Upvotes

r/BayesianProgramming • • Aug 02 '17

Bayesian Linear Regression (in PyMC) - a different way to think about regression

Thumbnail
chrisstucchio.com
7 Upvotes

r/BayesianProgramming • • Jul 03 '17

Stan Conference 2017 - YouTube

Thumbnail
youtube.com
7 Upvotes

r/BayesianProgramming • • Jun 26 '17

"Is Bayesian deep learning the most brilliant thing ever?" - a panel discussion

Thumbnail
youtube.com
7 Upvotes

r/BayesianProgramming • • Jun 21 '17

Introduction to Probabilistic Programming - YouTube

Thumbnail
youtube.com
7 Upvotes

r/BayesianProgramming • • May 26 '17

Everything that Works Works Because it's Bayesian: Why Deep Nets Generalize?

Thumbnail
inference.vc
7 Upvotes

r/BayesianProgramming • • Nov 17 '25

MCMC sampling for beginner

6 Upvotes

Beginner here. Was learning about sampling methods and was left a bit confused. If I understand correctly we want to sample in order to make certain estimates based on our samples and what MCMC essentially does - it allows us to generate those samples from complex distribution according to some methods. For instance Gibbs method with interchanging variable at every sweep, HMC with random variable selection and sampling with certain acceptance rate. Please can someone elaborate and confirm whether its understood correctly. I would also highly appreciate some real world example where we could use this method.


r/BayesianProgramming • • May 31 '25

Online / Real Time Bayesian Updating

6 Upvotes

Let’s say I fit an extremely complicated hierarchical model - a full fit takes a long time.

Now, we are given some new data. How do you go about incorporating this new data in to the model when you can’t afford a traditional full refit?

What techniques are used?


r/BayesianProgramming • • Nov 29 '24

Bayesian Beta-Binomial Example

Thumbnail nbviewer.jupyter.org
6 Upvotes

This Jupyter notebook provides a very simple example of Bayesian parameter estimation using the Beta-Binomial model. Both analytical and simulation-based results are presented. Three different approaches are used to obtain a parameter estimate for this model:

  • Exact Analytical Solution

  • Simple Non-MCMC Solution

  • MCMC Solution


r/BayesianProgramming • • Oct 06 '24

PyMC and PyTensor issues with a custom log-likelihood

6 Upvotes

Hi everybody,

I got an issue with some snippet of code trying to implement a NUTS to forecast the parameters of an asteroid. The idea is to define some uninformative priors for the orbital parameters. The likelihood is a custome one. The data I have are measures of Right Ascension (RA) and Declination (Dec) in some moment of time. So, the idea is to propagate an orbit given some orbital parameters, claculate the position of the asteroid in when I got the measurament, the adjusting for parallax effect i calculate the RA forecasted (RA_forecast) and the forcasted declination (Dec_forecast). The log-likelihood is the negative square error between the measured data and the forecasted ones - 0.5 *( (RA_measured - RA_forecast)**2 + (Dec_measure - Dec_forecast)**2).

I tried to implement the code using PyMC to easily programme a NUTS however i discovered that PyMC uses PyTensor under the hood to take care of the tensors and the orbital parameter defined in the priors are something strange. I wasn't able to print them as a vector (it's the first time i use PyMC). I tried to write a wrapper for my custom log-likelihood function but I keep not understanding the pytensor issue and I don't know how to overcome it. I tried to use aesera to write a workaround but it didn't work. Can anyone tell me how to understand PyMC, the PyTensor and what is the shape of the variable 'a' in this code ( a = pm.Uniform("a", lower=2, upper=7) ) ?
How can I convert a PyTensor into a numpy array or just an array and then back?
Is it possible to make PyMC work with a custom log-likelihood which is not a simple mathematical formula but more like a process?

As reference this is the error i got:
"Traceback (most recent call last):

  File "/Users/Desktop/Asteroid/src/HMC.py", line 253, in <module>

loglike = pm.Potential("loglike", custom_loglike(orbital_params, df, verbose=False), dims=1)

  File "/Users/Desktop/Asteroid/src/HMC.py", line 223, in custom_loglike

a_num = at.as_tensor_variable(a).eval()

  File "/Users/anaconda3/envs/astroenv/lib/python3.10/site-packages/aesara/tensor/__init__.py", line 49, in as_tensor_variable

return _as_tensor_variable(x, name, ndim, **kwargs)

  File "/Users/anaconda3/envs/astroenv/lib/python3.10/functools.py", line 889, in wrapper

return dispatch(args[0].__class__)(*args, **kw)

  File "/Users/anaconda3/envs/astroenv/lib/python3.10/site-packages/aesara/tensor/__init__.py", line 56, in _as_tensor_variable

raise NotImplementedError(f"Cannot convert {x!r} to a tensor variable.")

NotImplementedError: Cannot convert a to a tensor variable."

If anyone want more detail just ask me.

Thank you in advance!


r/BayesianProgramming • • Jul 21 '23

How the lead pipe detection model in Flint, Michigan, works

Post image
6 Upvotes

r/BayesianProgramming • • Jul 08 '22

Hanna van der Vlis - Clusterf*ck: A Practical Guide to Bayesian Hierarchical Modeling in PyMC3

Thumbnail
youtube.com
6 Upvotes

r/BayesianProgramming • • May 23 '22

Hierarchical Time Series With Prophet and PyMC3 by Matthijs Brouns

Thumbnail
youtube.com
6 Upvotes

r/BayesianProgramming • • Apr 03 '22

Stuart Russell's Blind Monopoly

6 Upvotes

In several interviews, Stuart Russell (author of one of the best books on AI: AIMA) mentions about a probabilistic programming implementation of a blind monopoly... I did some search and I wasn't able to find any... Di you know how to get it? Maybe another game is easier like tic-tac-toe?


r/BayesianProgramming • • Jan 11 '22

Football Analytics Using Hierarchical Bayesian Models in PyMC | PyData Global 2021

Thumbnail
youtube.com
6 Upvotes

r/BayesianProgramming • • Nov 02 '21

Handling indexing and new predictions with PyMC3

6 Upvotes

Disclaimer: I'm new to PyMC3 and Bayesian programming in general.

I'm working to create a multivariate linear model that has a mix of categorical and numeric variables. Using the index method for incorporating categoricals, I'm unable to add new data to predict due to data size mismatches.

This is because I can feed in the new dataframe for the numeric variables using .set_data() method, but not for categorical, because these were not built in the model using pm.Data(), but are just indices in the model formula.

How can I predict new data with categorical variables in the mix?

Here's an example with categorical factors from the Statistical Rethinking 2nd Ed:

with pm.Model() as m5_10:
    sigma = pm.Exponential("sigma", 1)
    mu_house = pm.Normal("mu_house", 0, 0.5, shape=d["house"].max() + 1)
    mu_clade = pm.Normal("mu_clade", 0, 0.5, shape=d["clade_id"].max() + 1)
    mu = mu_clade[d["clade_id"].values] + mu_house[d["house"].values]

    K = pm.Normal("K", mu, sigma, observed=d["K"])

    m5_9_trace = pm.sample()

az.summary(m5_9_trace, var_names=["mu_clade", "mu_house"])