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).

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

`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 |

`method` |
Character string which determines the measure used. |

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 *2π*. 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.

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

Maxime Genest.

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 |

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

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

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

Embedding an R snippet on your website

Add the following code to your website.

For more information on customizing the embed code, read Embedding Snippets.