Calculator Inputs
Enter data points, choose a kernel, control bandwidth, and generate fitted values.
Example Data Table
This sample shows mildly nonlinear growth that works well for smoothing demonstrations.
| Index | X | Y |
|---|---|---|
| 1 | 1.0 | 2.1 |
| 2 | 2.0 | 2.8 |
| 3 | 3.0 | 3.6 |
| 4 | 4.0 | 4.9 |
| 5 | 5.0 | 5.1 |
| 6 | 6.0 | 6.5 |
| 7 | 7.0 | 7.2 |
| 8 | 8.0 | 8.4 |
Formula Used
This page uses the Nadaraya-Watson kernel regression estimator.
Where:
- ŷ(x₀) is the predicted value at target point x₀.
- K(·) is the selected kernel function.
- h is the bandwidth controlling smoothness.
- xᵢ, yᵢ are the observed input-output pairs.
Common kernel rules used here:
The bandwidth matters more than the exact kernel in many practical cases. Small bandwidth values preserve local detail and noise. Large bandwidth values produce smoother estimates and stronger averaging.
How to Use This Calculator
- Enter the observed x values in the first field.
- Enter the matching y values in the second field.
- Add any target x points where you want predictions.
- Select a kernel function.
- Choose automatic or manual bandwidth control.
- Adjust grid points for the smooth fitted curve.
- Press the calculate button.
- Review the result cards, graph, prediction table, fit table, and local weight summary.
- Use the CSV or PDF buttons to export the report.
FAQs
1) What does kernel regression do?
Kernel regression estimates a smooth relationship between x and y without forcing a fixed global equation. It uses nearby observations to predict each target point and gives closer points more influence.
2) Why is bandwidth so important?
Bandwidth controls the size of the local neighborhood. Small values capture detail but may follow noise. Large values smooth more aggressively and may hide local structure. It is the main tuning parameter.
3) Which kernel should I choose?
Gaussian is a reliable default because it gives every point some weight. Epanechnikov, uniform, and triangular are compact kernels that ignore distant points once they fall outside the bandwidth window.
4) What does the prediction table show?
It lists each requested x value and the smoothed estimate produced by the selected kernel and bandwidth. Use it for interpolation, curve checking, and comparing multiple bandwidth settings.
5) What does the training fit table mean?
The table compares the observed y value against the fitted y value at each observed x. The residual column shows the difference and helps you judge underfitting or overfitting.
6) Is kernel regression the same as polynomial regression?
No. Polynomial regression fits one global equation across the full dataset. Kernel regression is local and nonparametric, so the fitted shape can bend differently in different regions of the data.
7) Can I use unevenly spaced x values?
Yes. Uneven spacing is allowed. Kernel regression naturally handles irregular x locations, although sparse areas may produce less stable predictions when the bandwidth is very small.
8) What do the local weights show?
The weight table ranks the observations that influence the first requested prediction. Higher normalized weights mean a point contributes more strongly to the estimated value at that target x.