Last active
August 21, 2020 05:21
-
-
Save WillKoehrsen/7b6d42332d5af2b5f1508b4d242814e4 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import pymc3 as pm | |
# Context for the model | |
with pm.Model() as normal_model: | |
# The prior for the data likelihood is a Normal Distribution | |
family = pm.glm.families.Normal() | |
# Creating the model requires a formula and data (and optionally a family) | |
pm.GLM.from_formula(formula, data = X_train, family = family) | |
# Perform Markov Chain Monte Carlo sampling letting PyMC3 choose the algorithm | |
normal_trace = pm.sample(draws=2000, chains = 2, tune = 500, njobs=-1) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
What is the formula?