欢迎来到天天文库
浏览记录
ID:53009764
大小:31.54 KB
页数:1页
时间:2020-04-11
《R语言回归分析做拟合.pdf》由会员上传分享,免费在线阅读,更多相关内容在学术论文-天天文库。
1、x=sort(runif(200))y=sin(10*x)+1+rnorm(200,0,0.1)fit.lm<-lm(y~x)plot(x,y)abline(fit.lm)require(KernSmooth)h=dpill(x,y)fit0=ksmooth(x,y,kernel="normal",bandwidth=h)plot(x,y)abline(fit0)fit=locpoly(x,y,degree=3,kernal="normal,handwidth=h")plot(x,y)lines(fit)abline(fit)
2、fit1=loess(y~x,degree=2)plot(x,y)lines(fit1)abline(fit1)predict(fit1,0.5)
此文档下载收益归作者所有