Package for specification of hierarchical statistical models

Suppose we are given a set of random variables X_1, X_2, \ldots, X_n and that we want to specify a statistical model involving these variables.

For example, one may be interested in specifying two marginals X_1 \sim \mathcal{N}(0, 1) and X_2 \sim \mathcal{N}(0, 2), and a correlation coefficient \rho between X_1 and X_2 to build the joint covariance.

Is there a package that allows the specification of statistical relations between subsets of random variables? How to represent and query these parameters without boilerplate code? In the Gaussian case, can we gain some additional expressivity?

I could generalize my question and ask if there is a lightweight package that provides a nice terse language to specify relations between variables and query the corresponding parameters. I mentioned random variables because that is the intended application, but am open to explore alternative packages that have a broader scope as well.

I think MixedModels.jl or Metida.jl can help you.