Learn R Programming

alR (version 2.2.0)

Silverman: Kernel density bandwidth estimators.

Description

Calculate the bandwidth estimator using various methods.

Usage

Silverman(x)

Silverman2(x)

bw(x, type)

Arguments

x

A vector of data points.

type

One of the following options:

  • -1: Silverman's rule of thumb.

  • -2: Silverman's adapted rule of thumb.

  • >0: The real number is returned without any calculations.

Value

Silverman: Bandwidth estimator based on Silverman's rule of thumb.

Silverman2: Bandwidth estimator based on Silverman's adapted rule of thumb.

bw: Bandwidth estimator based on the selected method.

Examples

Run this code
# NOT RUN {
set.seed(1)
x <- rnorm(100)
Silverman(x)

Silverman2(x)

bw(x, -1)
bw(x, -2)
bw(x, 0.5)

# }

Run the code above in your browser using DataLab