| dist_cstep | R Documentation |
This function calculates the Mahalanobis distances for a set of observations by centering them with the mean vector and using a covariance matrix computed as a weighted combination of the covariance matrix of the current item and the covariance matrices of its neighbors.
dist_cstep(init, i, lambda, weights)
init |
A list of items where each item contains the following elements:
|
i |
An integer index specifying which item from the |
lambda |
A numeric value representing the weight for the covariance matrix of the current item. |
weights |
A matrix of weights where each element |
The Mahalanobis distances are computed using the covariance matrix,
which is a weighted combination of the current item's covariance matrix and
those of its neighbors. The covariance matrix is smoothed using the parameter
lambda and the distances are computed as (x_centered^T * Cov_matrix_chol_inv * x_centered) for each observation.
A numeric vector of distances for each observation in the centered matrix.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.