What exactly are the default prior specification for glm.from_formula() patsy style?

Hey all,

I am new to pymc3 and had a question regarding the glm.from_formula() patsy style. How do I define the priors using model specification to get an equivalent model to what I get from using the glm.from_formula() syntax for logistic regression.

What is the equivalent model specification for the patsy style model given under here?

with pm.Model() as logistic_model:
    pm.glm.GLM.from_formula(fml,
                            data,
                            family=pm.glm.families.Binomial())
    #trace = pm.sample()
    approx= pm.fit(1000, method='advi',obj_optimizer=pm.adadelta())

Best

Hi Nick,
I’m not very familiar with the GLM module, but looking at the source code, it seems like it’s using very flat priors – probably equivalent to OLS:

    default_regressor_prior = Normal.dist(mu=0, tau=1.0E-6)
    default_intercept_prior = Flat.dist()

If you’re going fully Bayesian, it’s indeed good practice to specify the whole model yourself and to use much more informative priors (especially for GLMs).
Hope this helps :vulcan_salute: