Functions for Hierarchical Bayesian Estimation: A FlexibleApproach