This is my Stan code, wondered why covariance matrix T is not updating, but now I fixed it.
data {
int<lower=0> n;
vector[2] y[n];
real<lower=0> se[1, 2, n];
matrix[2,2] R;
real<lower=-1,upper=1> rho;
}
parameters {
vector[2] mu[n];
vector[2] beta;
cov_matrix[2] inv_T;
}
transformed parameters {
matrix[2,2] S[n];
for (j in 1:n){
S[j,1,1] = square(se[1,1,j]);
S[j,1,2] = rho * se[1,1,j] * se[1,2,j];
S[j,2,1] = rho * se[1,1,j] * se[1,2,j];
S[j,2,2] = square(se[1,2,j]);
}
}
model {
// Priors
for (m in 1:n){
mu[m] ~ multi_normal_prec(beta, inv_T);
}
inv_T ~ wishart(3, R);
beta ~ normal(0,10);
// Data
for (i in 1:n){
y[i] ~ multi_normal(mu, S[i]);
}
}
}