fitLS: Fitting splines with penalized least squares.

Description Usage Arguments Details Value Author(s) See Also Examples

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

1
fitLS(object, x, y, penalty = 0)

Arguments

object

The SplineBasis object ot be used to make the fit

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 (k_0,…,k_m). The likelihood is defined by

sum_i (y_i-b(x_i)mu) + integral mu^T b''(t)^T b''(t) mu dt

The fucntion estimates μ.

Value

a vector of the control points.

Author(s)

Andrew Redd <aredd at stat.tamu.edu>

See Also

SplineBasis

Examples

1
2
3
4
5
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)

Example output

Attaching package: 'orthogonalsplinebasis'

The following object is masked from 'package:stats':

    integrate

           [,1]
[1,]  -6.563343
[2,]  10.535190
[3,]  -5.904998
[4,]   2.957092
[5,]  13.036905
[6,]  62.784201
[7,]  88.525082
[8,] 148.675041

orthogonalsplinebasis documentation built on May 2, 2019, 5:47 p.m.