Questions:
- How can I implement univariate Nadaraya–Watson regression for prediction?
- What is the $x ,x_i$, and $y_i$? How can I select the $x ,x_i$, and $y_i$?
The sample for prediction and the shape of sample is like $[12,34,5,23]$. It is a list.
$$\hat{m}_n(x) = \sum_{i=1}^n \frac{K\left( \frac{x-x_i}{h}\right)Y_i}{\sum_{j=1}^n K \left( \frac{x-x_j}{h}\right)}$$