Non parametric regression prediction

Hi all, I am using the np package for nonparametric regression between 5 independent variables and 1 dependent variable. Once I got my bandwidth step and my regression done I tried to predict based on my regression, no matter the data I enter I get the same results. My question is is this a bad case of overfitting? Below the code I am using

library(np)
x1 = c(0.05, 1.35, 0.1, 0.45, 0.55, 1.5, 1.04, 0.65,0.4) #independent variables
x2=c(0.9,2.9,2.55,1.25,4.4,3.4,1.9,2.55,0.65)
x3=c(0.45,3, 2.4,3.1,4.6,1.35, 2.02, 1.3, 1.3)
x4 =c(2.9, 3.1, 0.85, 0.25,3.85,0.1,1.02,1.5,1.2)
x5 =c(9,0.15, 0.7, 0.55, 0.3,2.3,0.98,0.6,0.85)
y=c(0.109,2.22,0.585,4.02,1.75,0.298,0.214,0.4,0.567) ## dependent variable
xdat<-data.frame(x1,x2,x3,x4,x5) ## dataframe of independent variables, leave y as vector
wt<-c(0.00,0.0349,0.006,0.00,273,0.0308,0,0,0) ## newdata for prediction
## bandwidth step
try1<-npregbw(xdat = xdat,ydat=y, bandwidth.compute = TRUE,, itmax = 100000, bwtype = "fixed", regtype="lc")
     summary(try1)
     npsigtest(try1, boot.num = 10000)
## regression step
np.model<-npreg(bws=try1, newdata=wdata)
## prediction step
predict(np.model,newdata=wt)

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.