| .simplicial_depth_cpp | R Documentation |
Computes the simplicial depth of one or more query points with respect
to a reference distribution estimated from data, using an adaptive
Monte Carlo approximation.
.simplicial_depth_cpp(
x,
data,
tol = 0.05,
batch_size = 200L,
min_batches = 3L,
max_batches = 20L,
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). Must have at least d+1 rows. |
tol |
Relative standard error tolerance for the stopping rule. Default 0.05 (5%). |
batch_size |
Number of random simplices per batch. Default 200. |
min_batches |
Minimum number of batches before checking convergence. Default 3. |
max_batches |
Maximum number of batches regardless of convergence. Acts as a hard cap on computation time. Default 20. |
seed |
Integer random seed for reproducibility. Default 42. |
Simplicial depth of a point x with respect to distribution F is defined as the probability that a random simplex formed by d+1 independent draws from F contains x:
SD(x, F) = P(x \in S[X_1, \ldots, X_{d+1}])
where S[X_1, \ldots, X_{d+1}] denotes the closed simplex with
vertices X_1, \ldots, X_{d+1}.
This is estimated by sampling random simplices from the empirical distribution and checking containment via barycentric coordinates. The adaptive stopping rule uses the Bernoulli standard error to determine when the estimate has converged.
Numeric vector of depth values in [0, 1], one per query point.
Liu, R. Y. (1990). On a notion of data depth based on random simplices. Annals of Statistics, 18(1), 405–414.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.