Learn R Programming

ContaminatedMixt (version 1.0)

dCN: Multivariate Contaminated Normal Distribution

Description

Probability density function and random number generation for the multivariate contaminated normal distribution.

Usage

dCN(x, mu = rep(0,p), Sigma, alpha = 0.99, eta = 1.01) rCN(n, mu = rep(0,p), Sigma, alpha = 0.99, eta = 1.01)

Arguments

x
either a vector of length p or a matrix with p columns, being p = ncol(Sigma), representing the coordinates of the point(s) where the density must be evaluated
mu
either a vector of length p, representing the mean value, or (except for rCN) a matrix whose rows represent different mean vectors; if it is a matrix, its dimensions must match those of x
Sigma
a symmetric positive-definite matrix representing the scale matrix of the distribution; a vector of length 1 is also allowed (in this case, p = 1 is set)
alpha
proportion of good observations; it must be a number between 0 and 1
eta
degree of contamination; it should be a number greater then 1
n
the number of random vectors to be generated

Value

dCN returns a vector of density values; rCN returns a matrix of n rows of random vectors

References

Punzo, A. and McNicholas, P. D. (2013). Robust Clustering via Parsimonious Mixtures of Contaminated Gaussian Distributions. arXiv.org e-print 1305.4669, available at: http://arxiv.org/abs/1305.4669.

See Also

ContaminatedMixt-package

Examples

Run this code

point <- c(0,0,0)
mu <- c(1,-2,3)
Sigma <- diag(3)
alpha <- 0.8
eta <- 5
f <- dCN(point, mu, Sigma, alpha, eta)
x <- rCN(10, mu, Sigma, alpha, eta)

Run the code above in your browser using DataLab