I could use help with a coding error.
I have a 2x2 covariance matrix in which the sigmas on the diagonal are constrained to be identical. I have accomplished this previously by creating a temporary vector[2] in the transformed parameters in which the sigma gets assigned to both slots.
Although that has been successful in the past, now I’m getting an error about a base type mismatch. Code and error are both below:
transformed parameters{
matrix [ Nx_kl_dyad_ID , 2 ] v_kl_dyad_ID;
{
vector[2] sigma_kl_temp;
sigma_kl_temp[1] = sigma_kl_dyad_ID;
sigma_kl_temp[2] = sigma_kl_dyad_ID;
v_kl_dyad_ID = (diag_pre_multiply ( sigma_kl_temp, L_Rho_kl_dyad_ID) * z_kl_dyad_ID)';
}
}
Base type mismatch in assignment; variable name = sigma_kl_temp, type = real; right-hand side type=vector
error in ‘model1495a5dd847_b77ca46156986d60d2c94302d3b1843a’ at line 64, column 22
62: v_c__d_ID = ( diag_pre_multiply ( sigma_c__d_ID , L_Rho_c__d_ID ) * z_c__d_ID )’;
63:
64: sigma_kl_temp[1] = sigma_kl_dyad_ID;
^
65: sigma_kl_temp[2] = sigma_kl_dyad_ID;