Description Usage Arguments Details Value Author(s) References See Also Examples
View source: R/linearAlgebra-deltacapsq.R
Calculates the squared Mahalanobis distance.
1 | deltacapsq(x, mu, sigmacap)
|
x |
Numeric vector or matrix. |
mu |
Numeric vector. Center \boldsymbol{μ}. |
sigmacap |
Numeric matrix. Covariance matrix \boldsymbol{Σ}. |
The squared Mahalanobis distance is given by
\boldsymbol{Δ}^{2} = ≤ft( \mathbf{x} - \boldsymbol{μ} \right)^{\prime} \boldsymbol{Σ}^{-1} ≤ft( \mathbf{x} - \boldsymbol{μ} \right)
A vector.
Ivan Jacob Agaloos Pesigan
Wikipedia: Mahalanobis distance
Other Scaling Functions:
d()
,
z()
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 | x <- matrix(
data = stats::rnorm(n = 5 * 2),
ncol = 2
)
deltacapsq(
x,
mu = c(0, 0),
sigmacap = diag(2)
)
x <- rnorm(5)
deltacapsq(
x,
mu = 0,
sigmacap = 1
)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.