smed(P, sort=FALSE, depths=NULL, alpha=NULL, method="Tukey", tracecontour=FALSE, tracepoints=FALSE)P is already sorted.alpha is an optionnal numeric value between 0 and 1 to compute the median on a trimmed region rather than on the whole dataset. The trimming keeps only those points with a depth greater than or equal to alpha. The default value of NULL computes the median from the maximum depth trimmed region (i.e. no trimming).method can be "Tukey" (the default) or "Circular".method="Circular". Traces the plot of depth with respect to angular positions on the circle.method="Circular". Draws the points and their median on the circle.method="Tukey", the Tukey median is returned. If method="Circular", the circular median (the point minimizing the average distance based on arccosine) is returned.Mardia, K.V. and Jupp, E.J. (1999). Directional Statistics, Wiley.
sdepth for calculation of the depth of a point, scontour for Tukey's spherical median.set.seed(2011)
smed(runif(30,min=0,max=2*pi))
Run the code above in your browser using DataLab