Let us say we have data grouped in $m$ different classes, each of size $n_j$ for $j = 1,...,m$. We denote as $X_k^{(j)}$ the $k$-th member of group $j$. We want to simulate unit-variance random variables with a structure such that the "inner" correlation in group $j$ is $\rho_j$, and the "outer" correlation between groups $j$ and $i$ is $\rho_{ij}$, with the $\rho$'s as parameters. This is, $$ \begin{aligned} Var(X_k^{(j)}) &= 1 \quad \forall k,j \\ Cov(X_k^{(j)}, X_r^{(j)}) &= \rho_j \quad \forall k \neq r, j = 1,...,m\\ Cov(X_k^{(j)}, X_r^{(i)}) &=\rho_{ij} \quad \forall i\neq j, k\neq r \end{aligned} $$ Basically, I have grouped data and want to create a relationship structure both inside the groups and between the groups. I have tried approaching the problem by using the Gaussian copula and establishing $$ X_k^{(j)} = \sqrt{\beta_j}\, Z + \sqrt{\rho_j - \beta_j} \, Z_j + \sqrt{1-\rho_j} \, e_k^{(j)} $$ assuming both inner and outer correlations are positive, with $Z, Z_j, e_k^{(j)}$ i.i.d. $N(0,1)$. However, one finds that $$ \beta_i \beta_j = \rho_{ij}^2 $$ which I believe is not generally solvable, given there are more equations than variables. I even used non-linear optimization techniques to try and find an approximate solution, without luck (cannot approximate each $\rho_{ij}$ appropriately).
I would like to know if there is any literature regarding this kind of problems or models, or if it is even possible. Even though $\rho_j$ seem to be always positive in my data, I would like the model to be as flexible as possible.