medianCircular {circular}R Documentation

Median Direction

Description

Sample median direction and corresponding deviation measure for a vector of circular data

Usage

## S3 method for class 'circular'
median(x, na.rm = FALSE)
medianCircular(x, na.rm = FALSE, type = "Fisher", 
  deviation = FALSE, control.circular = list(), ...)

Arguments

x

a vector. The object is coerced to class circular.

na.rm

logical, indicating if NA's should be omitted.

type

the only implemented method is Fisher.

deviation

if TRUE a list with two objects is returned, the first component be the median, the second component be the deviation associated with the median.

control.circular

the attribute of the resulting object.

...

NotYetUsed.

Details

The Definition in equations 2.32 & 2.33 from N.I. Fisher's 'Statistical Analysis of Circular Data', Cambridge Univ. Press 1993. is implemented. Since version 0.4-4, the algorithm (not the definition) for the calculation of the median is changed. The function medianCircular is deprecated and it will be remove in the next release of the package. For a measure of spread associated to the circular median use function meandeviation.

Value

If dispersion==FALSE a scalar with the median of the data otherwise a list with the following two components

median

the median.

deviation

the associated deviation from the median.

The median is returned as an object of class circular with the attribute given by control.circular or from x if missed in control.circular.

Author(s)

Claudio Agostinelli and Alessandro Gagliardi

References

N.I. Fisher (1993) Statistical Analysis of Circular Data, Cambridge University Press.

R.Y. Liu and K. Singh (1992) Ordering Directional Data: Concepts of Data Depth on Circles and Spheres, The Annals of Statistics, vol. 20, n. 3, 1468-1484.

See Also

meandeviation, mean.circular, var.circular, summary.circular, rho.circular and medianHL.circular.

Examples

# Compute the median direction of a random sample of observations.
x <- circular(runif(50, circular(0), pi))
median(x) #only the median is returned
meandeviation(x) #mean deviation is reported
## Not run: 
  medianCircular(x) #only the median is returned
  medianCircular(x, deviation=TRUE) #both median and deviation are reported

## End(Not run)

[Package circular version 0.4-7 Index]