# Parameter specification
q <- 4 # number of dimensions
mu <- 1:q # mean vector
V <- toeplitz(exp(-seq(1:q))) # variance matrix
# Random sample
n <- 100
X <- rmNorm(n, mu, V)
# Calculate log density for each sampled vector
dmNorm(X, mu, V, log = TRUE)
Run the code above in your browser using DataLab