I need to generate 4 random variables that show a predefined correlation structure Sigma AND where certain values of Vars 1-4 are fixed.
As an illustrative example, consider the variables:
Var1 <- c(5, 8, 6, 7, 5, ., ., ., ., .) Var2 <- c(., ., ., ., ., 8, 5, 7, 8, 9) Var3 <- c(15, 17, 13, 27, 13, ., ., ., ., .) Var4 <- c(., ., ., ., ., 18, 25, 14, 32, 2)
Now I want to 'fill in' the dots with some variable values in such way that the correlation structure between the variables is close to some predefined correlation matrix Sigma, but keeping/fixing the 'known' values (e.g., keeping values 5, 8, 6, 7, 5 for Var1 on rows/positions 1 to 5, etc).
I know it is straightforward to generate random variables in line with some predefined correlation matrix Sigma (using Cholesky decomposition, see e.g., Generate a random variable with a defined correlation to an existing variable), but is there any way to fix some of the values of multiple variables?
Any help is much appreciated!