depth.sample | R Documentation |
Faster implementation of the halfspace and the simplicial depth. Computes the depth of a whole random sample of a univariate or a bivariate data in one run.
depth.sample(A, B)
A |
Univariate or bivariate points whose depth is computed, represented by a matrix of
size |
B |
Random sample points with respect to which the depth of |
The function returns vectors of sample halfspace and simplicial depth values.
Vector of length m
of depth halfspace depth values is returned.
Stanislav Nagy, nagy@karlin.mff.cuni.cz
depth.halfspace
depth.simplicial
n = 100
m = 150
A = matrix(rnorm(2*n),ncol=2)
B = matrix(rnorm(2*m),ncol=2)
depth.sample(A,B)
system.time(D1<-depth.halfspace(A,B))
system.time(D2<-depth.sample(A,B))
max(D1-D2$Half)
A = rnorm(100)
B = rnorm(150)
depth.sample(A,B)
# depth.halfspace(matrix(A,ncol=1),matrix(B,ncol=1))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.