Multilevel model with covariance of 3 variables

Thanks a lot for your help, Martin. The model you posted computes and provides pretty satisfactory results too.

I have two more questions, related to this model, that maybe you might help me with.

First, I was trying to write this model in mathematical form. Following this section of the radon notebook:

I came up with the following:

Do you think this mathematical representation is correct for the model you sent? What would the matrix P look like?

Also I’m trying to a obtain graphviz representation of this model, but for some reason when I try to use graphviz with covarying models, through the command

pm.model_to_graphviz(covarying_intercept_and_temp) 

I get the following error:

AttributeError: 'float' object has no attribute 'name' 

It’s a pretty vague error and I can’t seem to debug it. Graphviz works fine with every other model, but as soon as I introduce covarying terms this happens. Might be a long shot but maybe someone here encountered a similar issue at some point.

Thanks a lot for your help again!

1 Like