0
$\begingroup$

How can I implement univariate Nadaraya–Watson regression for prediction? And 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)}$$

$\endgroup$
1
  • $\begingroup$ You can check out this Jupyter notebook for a Python implementation. $\endgroup$ Commented Aug 17, 2020 at 10:12

1 Answer 1

0
$\begingroup$

$(x_i,y_i)$ are the training data set.

$x$ is the new point that you want to make prediction at that value. In your case, $x$ takes value from $[12, 34, 5, 23]$.

$\endgroup$
4
  • $\begingroup$ Can you recommend me the relevant code to see it? Thanks! $\endgroup$
    – Bingo Sun
    Commented Nov 17, 2018 at 12:51
  • $\begingroup$ is this a homework assignment? $\endgroup$ Commented Nov 17, 2018 at 12:55
  • $\begingroup$ no ,this is the first autoregressive algorithm I have encountered and I want to implement it. I am curious about its predictions work on univariate datasets, especially time series issues. $\endgroup$
    – Bingo Sun
    Commented Nov 17, 2018 at 13:00
  • $\begingroup$ here is a relevant discussion. $\endgroup$ Commented Nov 17, 2018 at 13:06

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.