fitLS {orthogonalsplinebasis} | R Documentation |
Fitting splines with penalized least squares.
Description
Estimates the control vector for a spline fit by penalized least squares. The penalty being the penalty parameter times the functional inner product of the second derivative of the spline curve.
Usage
fitLS(object, x, y, penalty = 0)
Arguments
object |
The |
x |
predictor variable. |
y |
response variable. |
penalty |
The penalty multiplier. |
Details
For numeric vector y, and x, and a set of basis functions, represented in object
, defined on the knots .
The likelihood is defined by
The function estimates .
Value
a vector of the control points.
See Also
Examples
knots<-c(0,0,0,0:5,5,5,5)
base<-SplineBasis(knots)
x<-seq(0,5,by=.5)
y<-exp(x)+rnorm(length(x),sd=5)
fitLS(base,x,y)
[Package orthogonalsplinebasis version 0.1.7 Index]