Help Vectorizing a Cross-Classified Model?

@Bob_Carpenter - I was going back through my old posts and I wanted to close the loop on this post and clarify how to adjust the code when a vector of effects is being estimated – You had written:

When writing out the non-centered parameterization when there are, let’s say, different residuals across groups (and it seems entirely reasonable that fixed effects won’t explain the variation equally across) — would it look something like this:

family_mu = model_mu[mm] + fammu_offset * fam_resid[mm];
family_mu[multten] = family_mu[multten] + char_m10;
family_mu[threedig] = family_mu[threedig] + char_d3;

where we have defined fammu_offset as a real number and distributed normal(0,1), or would we want to define the standardized variable as a vector?

I am asking, because I have defined fammu_offset as a vector and as a vector that I have indexed with [mm], meaning that although there are twenty-seven item families in my data there are only nine unique values being drawn, and I am not able to effectively recover the variance parameters used when simulating the data. I am able to recover the mean structure - but the variances are… elusive. I have been playing with different priors ( Cross-classified Hierarchical Model, Heterogenous Variances - #18 by bbbales2), and also exploring what happens when I change adapt_delta, have different numbers of chains and longer chains as well. I’m wondering if maybe the issue is simply that I am incorrectly implementing the non-centered parameterization?

@bbbales2 - I am editing this post to include your name since you were extremely helpful with my recent (related!) post, to see if you had any suggestions. I would love to say that I had everything figured out - but it seems that I’m not able to recover variance parameters successfully, and I think it is because I’m not specifying the non-centered parameterization correctly… My code works and values are successfully recovered when I’m estimating a single variance parameter rather than a vector of values.

Thanks so much,
Shauna