h.crit: Bandwidth calculation for density estimation

Description Usage Arguments Value Examples

View source: R/h.crit.R

Description

Calculates the smallest value so that the gaussian kernel density estimate of the given data x has k modes. The smaller you choose the bandwidth for a kernel density estimate, the larger the number of modes becomes. This function calculates the smallest value leading to a kernel density estimate with k number of modes.

Usage

1
h.crit(x, k, prec = 6, density.fun = NULL)

Arguments

x

vector of data

k

number of modes

prec

number of digits for precision of calculation

density.fun

A function that returns a vector of density estimates

Value

the smallest value so that the gaussian kernel density estimate of the given data x has k modes.

Examples

1
h.crit(rnorm(10), k = 1)

jenzopr/silvermantest documentation built on Nov. 4, 2019, 2:39 p.m.