Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bambi parser #300

Merged
merged 3 commits into from
Nov 29, 2023
Merged

bambi parser #300

merged 3 commits into from
Nov 29, 2023

Conversation

aloctavodia
Copy link
Contributor

@aloctavodia aloctavodia commented Nov 28, 2023

This allows the use of Bambi models for ppa and predictive_finder. I only tested the code with a couple of simple models.

def a_bambi_model(a0=2, a1=1, b0=2, b1=1):
    x = bmb.Prior("Normal", mu=a0, sigma=a1)
    Intercept = bmb.Prior("Normal", mu=b0, sigma=b1)
    priors = {"x": x, "Intercept": Intercept}

    model = bmb.Model('y ~ x', data, priors=priors)
    
    return Intercept, x, y

target = pz.Normal(2, sigma=3)
pz.predictive_finder(a_bambi_model, target, draws=100, steps=1, engine="bambi")

Figure 1

@aloctavodia aloctavodia merged commit 60480f8 into arviz-devs:main Nov 29, 2023
4 checks passed
@aloctavodia aloctavodia deleted the bambi branch November 29, 2023 12:16
This was referenced Feb 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant