mahalanofix | R Documentation |
Computes the vector of (classical or robust)
Mahalanobis distances of all points of x
to the center of the points indexed (or weighted)
by gv
. The latter also determine
the covariance matrix.
Thought for use within fixmahal
.
mahalanofix(x, n = nrow(as.matrix(x)), p = ncol(as.matrix(x)), gv =
rep(1, times = n), cmax = 1e+10, method = "ml")
mahalanofuz(x, n = nrow(as.matrix(x)), p = ncol(as.matrix(x)),
gv = rep(1, times=n), cmax = 1e+10)
x |
a numerical data matrix, rows are points, columns are variables. |
n |
positive integer. Number of points. |
p |
positive integer. Number of variables. |
gv |
for |
cmax |
positive number. used in |
method |
|
solvecov
is used to invert the covariance matrix. The methods
"mcd"
and "mve"
in mahalanofix
do not work properly
with point constellations with singular covariance matrices!
A list of the following components:
md |
vector of Mahalanobis distances. |
mg |
mean of the points indexed by |
covg |
covariance matrix of the points indexed by |
covinv |
|
coll |
logical. If |
Methods "mcd"
and "mve"
require library lqs
.
Christian Hennig christian.hennig@unibo.it https://www.unibo.it/sitoweb/christian.hennig/en/
fixmahal
, solvecov
, cov.rob
x <- c(1,2,3,4,5,6,7,8,9,10)
y <- c(1,2,3,8,7,6,5,8,9,10)
mahalanofix(cbind(x,y),gv=c(0,0,0,1,1,1,1,1,0,0))
mahalanofix(cbind(x,y),gv=c(0,0,0,1,1,1,1,0,0,0))
mahalanofix(cbind(x,y),gv=c(0,0,0,1,1,1,1,1,0,0),method="mcd")
mahalanofuz(cbind(x,y),gv=c(0,0,0.5,0.5,1,1,1,0.5,0.5,0))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.