fitLS: 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 SplineBasis object to be used to make the fit
x
predictor variable.
y
response variable.
penalty
The penalty multiplier.
Value
a vector of the control points.
Details
For numeric vector y, and x, and a set of basis functions, represented in object, defined on the knots \((k_0,\ldots,k_m)\).
The likelihood is defined by$$
\sum\limits_{i=1}^n(y_i-b(x_i)\mu) + \int\limits_{k_0}^{k_m} \mu^Tb^{\prime\prime}(t)^Tb^{\prime\prime}(t)\mu dt
$$
The function estimates \(\mu\).