Learn R Programming

DepthProc (version 2.1.5)

depthTukey: Tukey Depth

Description

Computes the Tukey depth of a point or vectors of points with respect to a multivariate data set.

Usage

depthTukey(u, X, ndir = 1000, threads = -1, exact = FALSE)

Arguments

u

Numerical vector or matrix whose depth is to be calculated. Dimension has to be the same as that of the observations.

X

The data as a matrix, data frame or list. If it is a matrix or data frame, then each row is viewed as one multivariate observation. If it is a list, all components must be numerical vectors of equal length (coordinates of observations).

ndir

number of directions used in computations

threads

number of threads used in parallel computations. Default value -1 means that all possible cores will be used.

exact

if TRUE exact alhorithm will be used . Currently it works only for 2 dimensional data set.

Details

Irrespective of dimension, Projection and Tukey's depth is obtained by approximate calculation.

Returns the depth of multivariate point u with respect to data set X.

Examples

Run this code
# NOT RUN {
x <- matrix(rnorm(3000), nc = 3)
depthTukey(x, ndir = 2000)
# }
# NOT RUN {
# Exact algorithm in 2d
x <- matrix(rnorm(2000), nc = 2)
depthTukey(x, exact = TRUE)

# }

Run the code above in your browser using DataLab