Good evening,
This post considers the same program as found in my previous post, but looks to build on the vectorized code and non-centered parameterizations.
In that code, the model is specified such that the variance across elements within each group (here, items within family) is the same across all groups:
parameters {
...
real<lower=0> sigma_item;
vector[K] betai_offset;
...
transformed parameters{
...
vector[K] betai;
betai = family_mu[parent] + betai_offset*sigma_item;
...
model {
betai_offset ~ normal(0,1);
...
I would like to specify the model so that variances are group-specific, e.g., vector [P] sigma_item
. I have not seen in any of the posts here how to specify NCP when the variances are group-specific, and I am wondering how to do this.
Would an appropriate approach look something like this, where matrix[K,P] betai_offset
is a diagonal matrix? …
parameters {
...
vector [P]<lower=0> sigma_item;
matrix[K,P] betai_offset;
...
transformed parameters{
...
vector[K] betai;
betai = family_mu[parent] + sigma_item*betai_offset;
...
model {
betai_offset ~ normal(0,1);
...
if betai_offset
needs to be a diagonal matrix, is there a clean way to specify this in the code?
Thank you for any suggestions.