Skip to content

Main content

Gaussian Kernel Density Estimator

Evaluate a univariate equally weighted Gaussian kernel density estimate at supplied points using an explicit absolute bandwidth, without automatic bandwidth selection or boundary correction.

Loading tool…

Description

Evaluate a univariate equally weighted Gaussian kernel density estimate at supplied points using an explicit absolute bandwidth, without automatic bandwidth selection or boundary correction.

Kernel density estimation builds a smooth density by placing a kernel at each sample value and adding their contributions. Bandwidth sets the smoothing scale in the same units as the observations; returned densities have reciprocal units, not probability mass per requested point.

Evaluate a univariate equally weighted Gaussian kernel density estimate at supplied points using an explicit absolute bandwidth, without automatic bandwidth selection or boundary correction.

When to use this tool

Use this tool to calculate kernel density estimator under the units, normalization, and boundary conventions below.

How to use the tool and how it works

  1. Supply bandwidth, points, sample in the field shapes below.
  2. Run the calculation. Correct format, shape, range, or undefined-statistic errors before interpreting a result.
  3. Read densities, points, sampleCount. Use the conventions below.

At each supplied point x, sum exp(−0.5((x−sample_i)/bandwidth)²), then divide by sample count, sqrt(2π) and bandwidth. Return densities in the original query-point order.1

Input fieldMeaning and unitsAccepted input
bandwidthPositive Gaussian kernel standard deviation in the sample's units, not a multiplier of sample standard deviation.Required. Finite number; strictly above 0.
pointsPointsRequired. Array of Finite number.; minimum items 1; maximum items 512.
sampleSampleRequired. Array of Finite number.; minimum items 1; maximum items 512.
Output fieldInterpretationReturned shape
densitiesEstimated density at each returned point, in inverse sample units.Required. Array of Finite number; minimum 0.; minimum items 1; maximum items 512.
pointsPointsRequired. Array of Finite number.; minimum items 1; maximum items 512.
sampleCountSample CountRequired. Safe integer; minimum 1; maximum 512.
json
{
  "input": {
    "bandwidth": 1,
    "points": [
      0,
      1,
      2
    ],
    "sample": [
      0,
      2
    ]
  },
  "output": {
    "densities": [
      0.22646662345731042,
      0.24197072451914337,
      0.22646662345731042
    ],
    "points": [
      0,
      1,
      2
    ],
    "sampleCount": 2
  }
}

Limitations and assumptions

  • Bandwidth is an absolute positive Gaussian standard deviation in the sample’s units. Densities have inverse units and need not be below one. There is no automatic bandwidth selection, boundary correction or finite-domain renormalization.
  • The field tables state structural bounds; cross-field constraints and bounded search or output budgets also apply. Unknown keys are rejected where the object contract disallows them. Input errors are distinct from null fields and deliberate invalid controls in a successful output.

Alternative or Complementary methods

Choose the statistic according to the question and data conventions. Inspect the supplied series or matrix and the stated assumptions before comparing outputs from implementations with different defaults.

References

  1. Tool behavior and example: Gaussian Kernel Density Estimator — tool.io

Similar or alternative tools

  • explicit edge count table

    Count explicit observations in supplied ordered histogram bins with final edge included, reporting outside count without clamping under/overflow into endpoint bins.

  • histogram bin edge challenge

    Generate observations exactly on or one supplied epsilon around explicit bin edges, retaining endpoint-policy membership and outside labels.