- d1=read.table("D:/data.txt",header=T)
- attach(d1)
- require(KernSmooth)
- par(mfrow=c(1,1))
- t=d1$t
- y=d1$theta
- plot(t,y)
- h=dpill(t,y)
- fit=locpoly(t,y,kernel="normal",bandwidth=h,)
- lines(fit)
- ##如何得到这个非参回归的拟合值和预测值
- par(mfrow=c(1,1))
- plot(t,y,ylab="角度11")
- lines(ksmooth(t,y,kernel="normal",bandwidth=1),lty=1)
- lines(loess.smooth(t,y,span=0.70,degree=1),lty=2)
- lines(supsmu(t,y,span="cv"),lty=4)
- legend(4,1.34,lty=c(1,2,4),legend=c("Average Kernel(bandwidth=5)","Loess(span=0.7)", "Supsmu Loess (CV)"))
- title("Kernel Regerssion of 角度 on 时间")
- ##如何得到这几个非参回归的拟合值和预测值


雷达卡



京公网安备 11010802022788号







