kernel() — Kernel smoothing

Predicts each point as a weighted average of nearby points.

kernel(bandwidth, x, y)

Key idea

Definition

a kernel weight that fades with distance
the bandwidth (neighbourhood width)
the point you predict at

In plain words

To guess the value here, peek at the neighbours and average them — but let the closest ones have the loudest say.

Where you'd use it

Frequently asked questions

What is kernel smoothing?
A way to fit a smooth curve through noisy points: each prediction is a weighted average of nearby data, with closer points weighted more; the bandwidth sets how far "nearby" reaches.