R: what is the vector of quantiles in density function dvmnorm

Just taking bivariate normal (X1, X2) as an example, by passing in x = (0, 0), you get P(X1 = 0, X2 = 0) which is a single value. Why do you expect to get a vector?

If you want a vector, you need to pass in a matrix. For example, x = cbind(c(0,1), c(0,1)) gives

P(X1 = 0, X2 = 0)
P(X1 = 1, X2 = 1)

In this situation, each row of the matrix is processed in parallel.

Leave a Comment