KernelDensity.EstimateDistribution Method

Estimates the probability density of the input variable.

Definition

Namespace: Numerics.NET.Statistics
Assembly: Numerics.NET (in Numerics.NET.dll) Version: 9.0.3
C#
public static ContinuousDistribution EstimateDistribution(
	Vector<double> input,
	Kernel kernel,
	double bandwidth = NaN,
	KernelDensityBandwidthEstimator bandwidthEstimator = KernelDensityBandwidthEstimator.NormalReference,
	double bandwidthAdjustment = 1,
	int dataPoints = -1,
	double padding = 3
)

Parameters

input  Vector<Double>
kernel  Kernel
The kernel to use for the estimation.
bandwidth  Double  (Optional)
Optional. The bandwidth.
bandwidthEstimator  KernelDensityBandwidthEstimator  (Optional)
Optional. The method used to compute the bandwidth.
bandwidthAdjustment  Double  (Optional)
Optional. A factor by which to adjust the bandwidth.
dataPoints  Int32  (Optional)
Optional. The number of data points to use in the approximation.
padding  Double  (Optional)
Optional. The space before the smallest element in input and after the largest element in input where the probability density should be approximated in units of the bandwidth. The default value is 3.

Return Value

ContinuousDistribution
The estimated distribution.

Remarks

When bandwidth is supplied, it is used as the bandwidth, and the value of bandwidthEstimator is ignored. Otherwise, the method specified by bandwidthEstimator is used to estimate the bandwidth. The default is to use the normal reference bandwidth, which minimizes the integrated square error under the assumption that the data is normal.

The bandwidth is multiplied by the bandwidthAdjustment, with a default value of 1. This makes it possible to specify a bandwidth as a fraction of the estimated bandwidth.

The probability density function (PDF) of the distribution is approximated using dataPoints points. If dataPoints is less than or equal to zero, then the larger of the length of input and 50 is used.

Exceptions

ArgumentNullException

input is null.

-or-

kernel is null.

See Also