edit: Added code that generated figures.
I’m open to the possibility that I’m interpreting these results wrong or my expected number of coefficients is incorrect, but I would think that should only be a total of 5 intercept terms (one for each county), but my analysis of the model shows that there are as many coefficients as there are observations.
pm.model_to_graphviz(hierarchical_model_varying_intercept_county_state)
The only part I’m confident that looks correct are the state coefficients since there should only be two.
with hierarchical_model_varying_intercept_county_state:
hierarchical_model_varying_intercept_county_state_idata = pm.sample(draws=500, return_inferencedata=True, tune=500, target_accept=0.95)
az.plot_forest(
hierarchical_model_varying_intercept_county_state_idata, var_names=“a_state”, figsize=(12, 2), r_hat=True, combined=True, textsize=16
);```
but when I pull up the county coefficients, you can see there are 15.
az.plot_forest(
hierarchical_model_varying_intercept_county_state_idata, var_names="a_county", figsize=(12, 6), r_hat=True, combined=True, textsize=16
);


