sdepth: Calculation of spherical depth

Description Usage Arguments Details Value Author(s) References See Also Examples

View source: R/sdepth.R

Description

Computes the spherical depth of a point with respect to a multivariate data set. Supports data on the circle or on the sphere.

Usage

1
sdepth(theta, P)

Arguments

theta

Numerical vector whose depth is to be calculated. The coordinate system must match that of the observations.

P

The data as a vector, a matrix, a data frame or a list.

Details

Computes the Tukey depth of theta with respect to the dataset P. For data on the circle, data must be expressed in polar coordinates as a angle in radians with values between 0 and . Data on the sphere can be expressed in Euclidean coordinates (n by 3 matrix) or in spherical coordinates (n by 2 matrix) where the first column contains θ and the second column φ. The type of coordinates is determined automatically based on the dimensions of the input.

Value

Returns the spherical depth of multivariate point theta with respect to the data set P.

Author(s)

Maxime Genest.

References

Liu, R.Y., Parelius, J.M. and Singh, K. (1999), Multivariate analysis by data depth: Descriptive statistics, graphics and inference (with discussion), Ann. Statist., 27, 783–858.

Mardia, K.V. and Jupp, E.J. (1999). Directional Statistics, Wiley.

See Also

scontour for depth graphics, smed for Tukey's spherical median.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
## Tukey spherical depth for a dataset on the circle
set.seed(2011)
sdepth(pi,runif(50,min=0,max=2*pi))

## Tukey spherical depth for data in spherical coordinates.
sdepth(c(pi,pi/2),cbind(runif(50,min=0,max=2*pi),runif(50,min=0,max=pi)))

## Tukey spherical depth for data in Eudlidean coordinates.
x=matrix(rnorm(150),ncol=3)
x=t(apply(x,1,function(y){y/sqrt(sum(y^2))}))
sdepth(x[1,],x)

depth documentation built on May 19, 2017, 9:58 a.m.

Search within the depth package
Search all R packages, documentation and source code

Questions? Problems? Suggestions? Tweet to @rdrrHQ or email at ian@mutexlabs.com.

Please suggest features or report bugs in the GitHub issue tracker.

All documentation is copyright its authors; we didn't write any of that.