cross_validation: Cross-Validation

Description Usage Arguments Details Value Source See Also

View source: R/cross_validation.R

Description

The cross-validation method is used to estimate an optimal bandwidth for kernel density estimation from a given set of bandwidths.

Usage

1
2
3
4
5
6
cross_validation(
  kernel,
  samples,
  bandwidths = logarithmic_bandwidth_set(1/length(samples), 1, 10),
  subdivisions = 1000L
)

Arguments

kernel

S3 object of class Kernel; the kernel to use for the estimator

samples

numeric vector; the observations.

bandwidths

strictly positive numeric vector; the bandwidth set from which the bandwidth with the least estimated risk will be selected.

subdivisions

positive numeric scalar; subdivisions parameter internally passed to integrate_primitive.

Details

Cross-validation aims to minimize the mean integrated squared error (MISE) of a kernel density estimator. The MISE is defined as the expectation of the squared L2-Norm of the difference between estimator and (unknown) true density.

For each bandwidth h given in bandwidths, cross_validation approximates the estimator-dependent part of the risk. The method then selects the bandwidth with the minimal associated risk.

Value

The estimated optimal bandwidth contained in the bandwidth set.

Source

Nonparametric Estimation, Comte [2017], ISBN: 978-2-36693-030-6

See Also

kernel_density_estimator for more information about kernel density estimators, pco_method and goldenshluger_lepski for more automatic bandwidth-selection algorithms.


hericks/KDE documentation built on Aug. 22, 2020, 12:04 a.m.