modalDirection: Estimate the modal direction

Description Usage Arguments Details Value Examples

View source: R/circGLMClassFunctions.R

Description

Estimates the mode as the midpoint of the highest density interval.

Usage

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

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.

Value

An angle in radians.

Examples

1
modalDirection(rvmc(30, 0, 2))

circglmbayes documentation built on Jan. 22, 2021, 5:09 p.m.