Estimates the mode as the midpoint of the highest density interval.
Usage
modalDirection(th, modebw = 0.1)
Arguments
th
A vector of angles in radians.
modebw
Numeric between 0 and 1. The modes are estimated by taking the
midpoint of a highest density interval. Specifically, the mode is the
midpoint of the interval that contains modebw of the values of
th. Reasonable values are roughly between .005 and .2, although
lower values may be reasonable there are a lot of observations in
th.
Value
An angle in radians.
Details
The highest density interval is computed as the shortest interval containing
modebw of the values in th. For circular data however, this
definition is not useful, and we should instead look for the shortest arc
that contains modebw of the data. This is done by rotating the data
such that the mean direction is pi, and then applying the usual linear
methods.