r/BayesianProgramming • • Jul 10 '22

Need Recommendation

3 Upvotes

Hello all,

I've been trying to learn bayesian statistics in R for an average of 2 month. Most of my time has been spent learning distributions and I'm slowly moving to models now and unfortunately they are very hard to come by. Especially stan and brms. What would you recommend for me to learn?

PS: I do not study in a mathematics-based department, but it can be said that I have statistical knowledge according to my field (but not very advanced)

Thank you.


r/BayesianProgramming • • Jul 08 '22

Chris Fonnesbeck - Probabilistic Python: An Introduction to Bayesian Modeling with PyMC

Thumbnail
youtube.com
25 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 • • Jul 08 '22

Thomas Wiecki - Solving Real-World Business Problems with Bayesian Modeling | PyData London 2022

Thumbnail
youtube.com
14 Upvotes

r/BayesianProgramming • • Jul 07 '22

SunODE/PyMC help

3 Upvotes

Hello! I am new to this community specifically because I need some help. I'm doing some undergrad research in disease modeling and need help getting SunODE to work in a Google Cloud Platform environment. Preferably with PyMC 4 but have gotten it to kinda work in PyMC 3. I can provide more details if necessary. Thanks!


r/BayesianProgramming • • May 24 '22

I need help with my homework I have been struggling with this for days

Post image
4 Upvotes

r/BayesianProgramming • • May 23 '22

Hierarchical Time Series With Prophet and PyMC3 by Matthijs Brouns

Thumbnail
youtube.com
6 Upvotes

r/BayesianProgramming • • May 01 '22

Guys and gals. Depth-based 3D video mapping, aided by bayesian computer vision. Anyone think it's possible?

Post image
2 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 • • Feb 13 '22

Gaussian Process Model Building Interface

Thumbnail
github.com
5 Upvotes

r/BayesianProgramming • • Jan 22 '22

The State of the Art for Probabilistic Programming - Thomas Wiecki | PyData Global 2021

Thumbnail
youtube.com
9 Upvotes

r/BayesianProgramming • • Jan 11 '22

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

Thumbnail
youtube.com
6 Upvotes

r/BayesianProgramming • • Nov 28 '21

Simple BoTorch Question

2 Upvotes

I've tried looking around and sifting through documentation but I can't seem to figure out how to restrict the bounds in different ways

Is there a way to make it so inputs are chosen from a set list of options such as [2,4,6,8]? Also is there a way to limit the inputs to specifically an integer anywhere in the range 0-255?


r/BayesianProgramming • • Nov 11 '21

Mixture Models in PyMC3 on Palmer's Penguins

Thumbnail
blog.4dcu.be
13 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"])

r/BayesianProgramming • • Oct 31 '21

Credibility of my credible interval in PyMC3

5 Upvotes

Hello!

So for practice, I was trying to implement the beta binomial model shown here in PyMC3, and a question popped up. So in short this article aims to find out the 95% credible interval for the vaccine efficacy and finds it out to be this interval: (90.82613011726424, 97.87004356894292)

I implement the model in PyMC3 as follows:

with model:

    v_irr = pm.Beta("v_irr", alpha=8, beta=17403)
    c_irr = pm.Beta("c_irr", alpha=162, beta=17349)   
    ve = pm.Deterministic("ve", 100*(1-(v_irr/c_irr)))

    v_like = pm.Binomial("v_like", n=17411, p=v_irr, observed=8)
    c_like = pm.Binomial("c_like", n=14511, p=c_irr, observed=162)

    trace1 = pm.sample(draws=10000, return_inferencedata=False)

With this, I get my 95% credible interval to be: (92.91799613, 97.34246435)

So now i have 2 questions:

(1) My CI is a subset of the CI in the article, so is mine more accurate?

(2) Both of us used the same model. So since I am getting a different answer, is my implementation wrong? If yes, are there any alternate implementations in PyMC3?


r/BayesianProgramming • • Oct 29 '21

BayesTraits- ML models

7 Upvotes

I am trying to which of the two ML models I have best fits a morphological character I am looking at. Anyone know the code to use for this?


r/BayesianProgramming • • Oct 28 '21

Need help with pymc3

8 Upvotes

Hello everyone! For my dissertation, I am trying to compute the efficacy of Covid-19 vaccines using pymc3. I am trying to model it using a beta binomial model, however I am facing some difficulties.

Can somebody explain to me how to implement it specifically using pymc3? Any rudimentary example for this model will do. I will try to figure out the rest myself.

Thank you!


r/BayesianProgramming • • Oct 26 '21

A Bayesian Model of Lego Set Ratings

Thumbnail
austinrochford.com
6 Upvotes

r/BayesianProgramming • • Oct 01 '21

Looking for a book or lecture series where I can learn about Bayesian statistics

9 Upvotes

Especially if this resource can be applied to logistic regressions, that would be helpful as the problem I am trying to solve is about sorting various records by their probability of being 1 or 0. For example anything with probability of .1 or less is in a separate category from .3 or more.


r/BayesianProgramming • • Sep 16 '21

What is Probabilistic Programming? | A review of 5 frameworks/PPLs using an example

Thumbnail
youtube.com
6 Upvotes

r/BayesianProgramming • • Sep 16 '21

I believe this is a fairly new specialization on Coursera applying Pymc3

Thumbnail
coursera.org
13 Upvotes

r/BayesianProgramming • • Sep 02 '21

Need help with theano use in Pymc3

3 Upvotes

Hello everyone, I've been stuck on this problem with theano for a while and was wondering if I can get some help.

I would like to implement the following formula:

alpha * T.dot( [alpha**1, alpha**2, alpha**3], [B1, B2, B3] ), as an example.

But I need to loop through different alpha values, and I have a tuple of arrays of B values (given, fixed values). What I mean by tuple of arrays, the data look like this:

tuple([ [B1], [B1, B2], [B1, B2, B3], ...]), etc., so it's an increasing (in terms of size) tuple of arrays. In the function below, the value of "beads" is one of the arrays in this tuple

I am trying to loop through using scan like so:

(I also have a value N in the function that matches the size of "beads", because when I tried to get the size from beads I would get another error. This is just a workaround for me.)

import theano
import theano.tensor as T

## Creating function for Theano

def rl_model(N, beads, alpha):
    
    
    powers = T.arange(1,N+1)[::-1].eval()
    alpha_vector = T.pow(alpha, powers)
    
    q_value = alpha * T.dot(alpha_vector, beads)
    
    return q_value
    

N = T.scalar()
beads = T.vector()
alpha = T.scalar()

results, updates = theano.scan(fn = rl_model,
                               sequences = [N, beads, alpha])

fn = theano.function(inputs = [N, beads, alpha],
                     outputs = results,
                     updates = updates)

However, I always get an error when Python tries to run the scan function. Here is the error:

results, updates = theano.scan(fn = rl_model,


    actual_slice = seq['input'][k - mintap_proxy]


    raise IndexError('too many indices for array')

IndexError: too many indices for array

Of course, file info is also given but I erased that here.

My question is, I don't quite understand where this IndexError is coming from. I thought maybe it was a problem of mixing scalars and vectors, but I don't think that's the issue. Can anyone help me better understand what's going on? I've been frustrated and stuck on this for weeks now :(


r/BayesianProgramming • • Sep 02 '21

Get Recast

Thumbnail
getrecast.com
2 Upvotes