8. Implementation of hierarchical models