median: Median rotation

medianR Documentation

Median rotation

Description

Compute the sample projected or geometric median.

Usage

## S3 method for class 'SO3'
median(
  x,
  na.rm = FALSE,
  type = "projected",
  epsilon = 1e-05,
  maxIter = 2000,
  ...
)

## S3 method for class 'Q4'
median(
  x,
  na.rm = FALSE,
  type = "projected",
  epsilon = 1e-05,
  maxIter = 2000,
  ...
)

Arguments

x

n-by-p matrix where each row corresponds to a random rotation in matrix form (p=9) or quaternion (p=4) form.

na.rm

a logical value indicating whether NA values should be stripped before the computation proceeds.

type

string indicating "projected" or "geometric" type mean estimator.

epsilon

stopping rule.

maxIter

maximum number of iterations allowed before returning most recent estimate.

...

additional arguments.

Details

The median-type estimators are defined as

argmin∑ d(Ri,S).

If the choice of distance metric d is Riemannian then the estimator is called the geometric median, and if the distance metric in Euclidean then it is called the projected median. The algorithm used in the geometric case is discussed in hartley11 and the projected case is in stanfill2013.

hartley11 stanfill2013

Value

Estimate of the projected or geometric median in the same parametrization.

See Also

mean.SO3, bayes.mean, weighted.mean.SO3

Examples

Rs <- ruars(20, rvmises, kappa = 0.01)

# Projected median
median(Rs)

# Geometric median
median(Rs, type = "geometric")

# Bias of the projected median
rot.dist(median(Rs))

# Bias of the geometric median
rot.dist(median(Rs, type = "geometric"))

Qs <- as.Q4(Rs)

# Projected median
median(Qs)

# Geometric median
median(Qs, type = "geometric")

# Bias of the projected median
rot.dist(median(Qs))

# Bias of the geometric median
rot.dist(median(Qs, type = "geometric"))

rotations documentation built on June 25, 2022, 1:06 a.m.