Learn R Programming

face (version 0.1-1)

select.knots: Knots selection for P-spline smoothing

Description

Construct knots from either quantiles of observed time points or equally-spaced time points.

Usage

select.knots(t,knots=10,p=3,option="quantile")

Arguments

t
Observed time points.
knots
Number of interior knots.
p
Degrees of B-splines to be used.
option
Default "quantile":quantiles of t; if "equally-spaced", then equally-spaced time points in the range of t.

Value

A vector of knots

Details

The number of knots in the output will be knot plus 2 times p; and the B-spline basis matrix constructed from this vector of knots with degrees p will be knots plus p.

Examples

Run this code
t <- rnorm(100)
knots <- select.knots(t)

Run the code above in your browser using DataLab