findModes: Differentiate between specific forms of uni- and bi-modality

Description Usage Arguments Value Examples

Description

If there is one mode on either side of zero, then this function attempts to return the location of those two modes. If there is only one mode, the function attempts to return the location of that mode. The algorithm is based on optimizing over the negative numbers, then over the positive numbers, and seeing if either is on the boundary. This is not well tested.

Usage

1
findModes(den, tol = 0.01)

Arguments

den

output of logspline

tol

tolerance when comparing modes with zero

Value

A vector with the location of one or two modes

Examples

1
2
3
4
5
set.seed(1)
x <- rnorm(1000, c(-2, 2), 1)
den <- logspline(x)
plot(den)
abline(v = findModes(den))

stevencarlislewalker/ecoBayesIRT documentation built on May 30, 2019, 4:42 p.m.