Skip to contents

Add multivariate normal contour to plot

Usage

curve_mvnorm(
  mu,
  Sigma,
  level = c(seq(0.1, 0.9, 0.1), 0.99),
  col = 1,
  alpha = 0.1,
  ...
)

Arguments

mu

Vector of MVNormal center.

Sigma

Covariance matrix of MVNormal.

level

The values the of cumulative density to plot contours.

col

Color of the contours.

alpha

Opacity of the contours.

...

Further arguments passed to graphics::lines().

Examples

mu = c(.5, .7)
Rho = matrix(c(
    1, .2,
   .2,  1 ), nrow=2, byrow=T)
s = c( 1.5, 1.2 )
Sigma = diag(s) %*% Rho %*% diag(s)
x = MASS::mvrnorm(50, mu, Sigma)
plot(x)
curve_mvnorm(mu, Sigma)