1 / 3

Recitation 2 April 23

Recitation 2 April 23. Natural Cubic Splines P enalized Cubic R egression Splines. Natural Cubic Splines. Cubic splines. sm.spline () in library “ pspline ” How to choose a smoothing parameter by OCV score: sm.spline ( x= , y= , cv= TRUE )

cerise
Download Presentation

Recitation 2 April 23

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Recitation 2April 23 Natural Cubic Splines Penalized Cubic Regression Splines

  2. Natural Cubic Splines Cubic splines • sm.spline() in library “pspline” • How to choose a smoothing parameter • by OCV score: sm.spline(x= , y= , cv= TRUE) • by GCV score: sm.spline(x= , y= , cv= FALSE) • R demo 1 NCS -- linearity beyond boundary

  3. Penalized Cubic Regression Splines • gam() in library “mgcv” • gam( y ~ s(x, bs=“cr”, k=n.knots) , data = dataset) • Find the optimal smoothing parameter • By default, only select smoothing parameter by GCV score • R demo 2

More Related