This function constructs an object representing a normal distribution. If the length of the mean vector mu is 1, it creates a univariate normal distribution. Otherwise, it creates a multivariate normal distribution.

mvn(mu, sigma = diag(length(mu)))

Arguments

mu

A numeric vector specifying the means of the distribution. If mu has length 1, a univariate normal distribution is created. If mu has length > 1, a multivariate normal distribution is created.

sigma

A numeric matrix specifying the variance-covariance matrix of the distribution. It must be a square matrix with the same number of rows and columns as the length of mu. Default is the identity matrix of size equal to the length of mu.

Value

If mu has length 1, it returns a normal object. If mu has length > 1, it returns an mvn object. Both types of objects contain mu

and sigma as their properties.