Hello, i was wondering if it is possible to rename intercept in glm.from_formula, or generaly if it is possible to use hiearchical modeling using glm_formula? Example of what I’d like to do is:
import pymc3 as pm
import pandas as pd
data = pd.read_csv("data.csv")
with pm.Model() as logistic_model:
pm.glm.GLM.from_formula('action_1 ~ x_1 + x_2 + x_3 + x_4',
data,
family=pm.glm.families.Binomial())
pm.glm.GLM.from_formula('action_2 ~ x_1 + x_2 + x_3 + x_4 + action_1',
data,
family=pm.glm.families.Binomial())
trace = pm.sample(1000, tune=1000, init='adapt_diag')
The error i get trying something like that is:
“ValueError: Variable name Intercept already exists.”
Something like that would lead to easy implementation of Gaussian Bayesian Networks using pymc3.