# Define the population means
mu <- c(0, 1, 2)
# Define the covariance of the population
Sigma <- diag(1,3)
Sigma[1,2] <- Sigma[2,1] <- 0.3
Sigma[2,3] <- Sigma[3,2] <- 0.1
Sigma[1,3] <- Sigma[3,1] <- -0.2
# Generate a 'random' sample from the population that is partially observed
x <- c(NA, 2, 4)
# Impute the missing values
impute_conditional_mean (x=x, mu=mu, Sigma=Sigma)
Run the code above in your browser using DataLab