1
$\begingroup$

I have climate data for 240 predictors and precipitation flux (as the target variable) for 3000+ days. I want to use Gaussian kernel regression to predict the precipitation flux for the next 2000+ days.

I have gone through some of the available packages in both R and MatLab.

R has the np package which provides the npreg() to perform kernel regression. However, the documentation for this package does not tell me how I can use the model derived to predict new data.

Similarly, MatLab has the codes provided by Yi Cao (ksrmv.m) and Youngmok Yun (gaussian_kern_reg.m). Here as well, I am unable to understand how to use the model obtained to predict the new data.

I would be very grateful if someone can explain to me how to perform prediction using any one of these methods.

$\endgroup$
  • 1
    $\begingroup$ For ksrmv.m, the documentation comment says: r=ksrmv(x,y,h,z) calculates the regression at location z (default z=x). So x is your training data, y their labels, h the bandwidth, and z the test data. For gaussian_kern_reg.m, you call gaussian_kern_reg(xs, x, y, h); xs are the test points. For npreg, the argument to use for the test data is newdata (which it calls "evaluation data": the points where you're evaluating the model). $\endgroup$ – Dougal Oct 16 '15 at 19:54
  • $\begingroup$ For npreg you can use predict to get eval at data. As an example: predict(your_npreg_result, newdata = data.frame_of_new_data) $\endgroup$ – Rodrigo Zepeda Jul 5 '17 at 21:29
  • $\begingroup$ The documentation of np at pag. 11 tells you how to make predictions $\endgroup$ – Andrea Araldo Apr 26 '18 at 13:21

Your Answer

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

Browse other questions tagged or ask your own question.