正在加载图片...
Regression splines (parametric Smoothing splines (nonparametric B-splines in R o Fortunately,one can use B-splines without knowing the details behind their complicated construction o In the splines package (which by default is installed but not loaded),the bs()function will implement a B-spline basis for you X <-bs(x,knots=quantile(x,p=c(1/3,2/3))) X <-bs(x,df=5) X<-bs(x,degree=2,df=10) Xp <-predict(X,newdata=x) o By default,bs uses degree=3,knots at evenly spaced quantiles,and does not return a column for the intercept Patrick Breheny STA 621:Nonparametric StatisticsIntroduction Regression splines (parametric) Smoothing splines (nonparametric) B-splines in R Fortunately, one can use B-splines without knowing the details behind their complicated construction In the splines package (which by default is installed but not loaded), the bs() function will implement a B-spline basis for you X <- bs(x,knots=quantile(x,p=c(1/3,2/3))) X <- bs(x,df=5) X <- bs(x,degree=2,df=10) Xp <- predict(X,newdata=x) By default, bs uses degree=3, knots at evenly spaced quantiles, and does not return a column for the intercept Patrick Breheny STA 621: Nonparametric Statistics
<<向上翻页向下翻页>>
©2008-现在 cucdc.com 高等教育资讯网 版权所有