Learn R Programming

etasFLP (version 2.2.2)

bwd.nrd: Silverman's rule optimal for the estimation of a kernel bandwidth

Description

Computes the optimal bandwidth with the Silverman's rule of thumb, to be used for a kernel estimator with given points and weights.

Usage

bwd.nrd(x, w=replicate(length(x),1), d = 2)

Value

The value of the bandwidth for a sample x and weights w.

Arguments

x

numeric vector: sample points to be used for a normal kernel estimator.

w

numeric vector of the same length of x: weights to give to the elements of x. Default is a vector of ones

d

number of dimensions of the kernel estimator.

Author

Marcello Chiodi

Details

Computes the optimal bandwidth with the Silverman rule, for a kernel estimator with points x and weights w. If a multivariate kernel is used, (i.e. d > 1), bwd.nrd must be called for each variable. It computes dispersion only with the weighted standard deviation, with no robust alternative. Called by kde2dnew.fortran.

References

Silverman, B.W. (1986). Density Estimation for Statistics and Data Analysis. Chapman and Hall: London.

Examples

Run this code
#####

Run the code above in your browser using DataLab