# strmeasure: Computing trimmed measures of sherical location In depth: Nonparametric Depth Functions for Multivariate Analysis

## Description

Computes a sample trimmed measure of location based on the spherical Tukey's depth. Supports data on the circle or on the sphere (for Circular median only).

## Usage

 `1` ```strmeasure(P,sorted=FALSE,depths=NULL,alpha=0,method="Mean") ```

## Arguments

 `P` The data as a vector, a matrix, a data frame or a list. `sorted` Logical; if TRUE, it indicates that the data given in first argument is sorted. `depths` An optionnal vector of the same length of P that contains the Tukey's depth of each data. The calculation of the depth is then skipped and the provided values are used instead. `alpha` 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 0 computes the median from the maximum depth trimmed region (i.e. no trimming). `method` Character string which determines the measure used. `method` can be "Mean" (the default) to compute trimmed mean direction or "Tukey" (for circular sample only) to compute trimmed Tukey's median.

## Details

This function returns a location estimate (Tukey's median or mean direction) of a sample truncated by Tukey's depth. 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.

While the option `method="Tukey"` supports only data on the circle, `method="Mean"` can also handle data on the sphere.

## Value

If the input sample is on the circle, a numeric value between 0 and giving the trimmed measure. If the input sample is on the sphere, the trimmed measure in Euclidean coordinates.

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.

`sdepth` for the calculation of the depth of a point, `scontour` for Tukey's spherical median.
 ```1 2 3 4 5 6 7``` ```## calculation of trimmed mean direction set.seed(2011) strmeasure(runif(30,min=0,max=2*pi),alpha=1/3,method="Mean") ## calculating of trimmed Tukey median set.seed(2011) strmeasure(runif(30,min=0,max=2*pi),alpha=1/3,method="Tukey") ```