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$
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$
  • $\begingroup$ Can you recommend me the relevant code to see it? Thanks! $\endgroup$ – Bingo Sun Nov 17 '18 at 12:51
  • $\begingroup$ is this a homework assignment? $\endgroup$ – Siong Thye Goh Nov 17 '18 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 Nov 17 '18 at 13:00
  • $\begingroup$ here is a relevant discussion. $\endgroup$ – Siong Thye Goh Nov 17 '18 at 13:06

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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