KernelDensity Class

Contains methods for computing kernel density estimates.

Definition

Namespace: Numerics.NET.Statistics
Assembly: Numerics.NET (in Numerics.NET.dll) Version: 10.9.0
C#
public static class KernelDensity
Inheritance
Object  →  KernelDensity

Remarks

Use the methods in the KernelDensity class to perform kernel density estimation on a variable. Methods for estimating a suitable bandwidth are also available.

KernelDensity also defines several kernels, including the GaussianKernel, UniformKernel (flat top kernel), and EpanechnikovKernel.

Observations must be nonempty and finite. Explicit and adjusted bandwidths must be finite and positive. Automatic selection requires at least two observations with positive spread; a zero interquartile range falls back to population standard deviation. Constant data requires an explicit bandwidth.

Point evaluation propagates NaN queries and returns zero at either infinity. Batch results preserve query order and query labels. Input observations and their labels are not modified.

Methods

Estimate(Vector<Double>, Vector<Double>, Double, Func<Double, Double>)Estimates densities at supplied points using a normalized custom kernel.
Estimate(Vector<Double>, Double, Double, Func<Double, Double>)Estimates the density at one point using a normalized custom kernel.
Estimate(Vector<Double>, Kernel, Vector<Double>, Double, KernelDensityBandwidthEstimator, Double) Estimates the density of the input
Estimate(Vector<Double>, Kernel, Double, Double, KernelDensityBandwidthEstimator, Double) Estimates the density of the input
Estimate(Vector<Double>, Kernel, Int32, Double, Double, Double, Double, KernelDensityBandwidthEstimator, Double) Estimates the density of the input.
EstimateBandwidth Estimates the bandwidth for kernel density estimation using the specified data and method.
EstimateDistribution Estimates the probability density of the input variable.
EstimateEpanechnikov(Vector<Double>, Vector<Double>, Double)Estimates densities at the supplied points using an Epanechnikov kernel.
EstimateEpanechnikov(Vector<Double>, Double, Double)Estimates the density at one point using an Epanechnikov kernel.
EstimateGaussian(Vector<Double>, Vector<Double>, Nullable<Double>)Estimates densities at the supplied points using a Gaussian kernel.
EstimateGaussian(Vector<Double>, Double, Nullable<Double>)Estimates the density at one point using a Gaussian kernel.
EstimateGaussianBandwidthEstimates a Gaussian normal-reference bandwidth in observation units.
EstimateTriangular(Vector<Double>, Vector<Double>, Double)Estimates densities at the supplied points using a triangular kernel.
EstimateTriangular(Vector<Double>, Double, Double)Estimates the density at one point using a triangular kernel.
EstimateUniform(Vector<Double>, Vector<Double>, Double)Estimates densities at the supplied points using a uniform kernel.
EstimateUniform(Vector<Double>, Double, Double)Estimates the density at one point using a uniform kernel.
FitFits a reusable kernel density estimate with optional relative observation weights.
FitReflectedFits a Gaussian density with reflection boundary correction.
FitTransformedFits a boundary-corrected density in log or logit coordinates.
NormalReferenceBandwidth Returns the kernel-specific normal reference bandwidth.
ScottBandwidth Returns the bandwidth for kernel density estimation based on Scott's rule.
SilvermanBandwidth Returns the bandwidth for kernel density estimation based on Silverman's rule.

Fields

BiweightKernel Represents a bi-weight kernel.
CosineKernel Represents a cosine kernel.
CosineKernel2 Represents an alternative cosine kernel.
EpanechnikovKernel Represents an Epanechnikov kernel.
GaussianKernel Represents a Gaussian kernel.
LogisticKernel Represents a logistic kernel.
TriangularKernel Represents a kernel shaped like a triangle.
TricubicKernel Represents a tri-cubic kernel.
TriweightKernel Represents a tri-weight kernel.
UniformKernel Represents a uniform kernel, shaped like a rectangle.

See Also