| .projection_depth_cpp | R Documentation |
Computes the projection depth of one or more query points with respect
to a reference distribution estimated from data, using an adaptive
random projection approximation.
.projection_depth_cpp(
x,
data,
tol = 0.01,
batch_size = 100L,
min_batches = 5L,
patience = 3L,
seed = 42L
)
x |
Numeric matrix of query points (m x d), or a numeric vector of length d for a single query point. |
data |
Numeric matrix of reference data (n x d). |
tol |
Convergence tolerance for the adaptive stopping rule. Default 0.01. |
batch_size |
Number of random projections per batch. Default 100. |
min_batches |
Minimum batches before checking convergence. Default 5. |
patience |
Consecutive stable batches required to declare convergence. Default 3. |
seed |
Integer random seed for reproducibility. Default 42. |
Projection depth is defined via the Stahel-Donoho outlyingness measure:
O(x, F) = \sup_{u \neq 0} \frac{|u^\top x - \mathrm{med}(u^\top F)|}
{\mathrm{MAD}(u^\top F)}
PD(x, F) = \frac{1}{1 + O(x, F)}
where med and MAD are the median and median absolute deviation of the projected distribution. The supremum is approximated by the maximum over random unit vector projections.
Numeric vector of depth values in (0, 1], one per query point.
Zuo, Y. & Serfling, R. (2000). General notions of statistical depth function. Annals of Statistics, 28(2), 461–482.
Stahel, W. A. (1981). Robuste Schätzungen: infinitesimale Optimalität und Schätzungen von Kovarianzmatrizen. PhD thesis, ETH Zürich.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.