Description Usage Arguments Details Value Source See Also
View source: R/cross_validation.R
The cross-validation method is used to estimate an optimal bandwidth for kernel density estimation from a given set of bandwidths.
1 2 3 4 5 6 | cross_validation(
kernel,
samples,
bandwidths = logarithmic_bandwidth_set(1/length(samples), 1, 10),
subdivisions = 1000L
)
|
kernel |
S3 object of class |
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 |
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.
The estimated optimal bandwidth contained in the bandwidth set.
Nonparametric Estimation, Comte [2017], ISBN: 978-2-36693-030-6
kernel_density_estimator
for more information about
kernel density estimators, pco_method
and
goldenshluger_lepski
for more automatic bandwidth-selection
algorithms.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.