Multilevel model with covariance of 3 variables

Hi Benedetto,

Your mathematical form looks good to me!

The matrix P is a correlation matrix. I think pymc3 should return you samples from chol_corr, which are the entries of this matrix. These entries will tell you how correlated the coefficients are. For example, the entry chol_corr[0, 1] will give you samples from the correlation between \alpha and \beta_h within clusters. If it’s high, then a cluster with a high \alpha will tend to also have a high \beta_h, for example. Similarly, chol_corr[0, 2] will give you samples from the correlation between \alpha and \beta_c. Let me know if that makes sense.

I’m afraid I haven’t used the graphviz functionality in pymc3, so I don’t know what’s causing that error – hopefully someone else knows!

Best,
Martin

1 Like