Learn R Programming

face (version 0.1-3)

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="equally-spaced")

Arguments

t

Observed time points.

knots

Number of interior knots.

p

Degrees of B-splines to be used.

option

Default "equally-spaced": equally-spaced time points in the range of t; if "quantile", then quantiles 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
# NOT RUN {
t <- rnorm(100)
knots <- select.knots(t)
# }

Run the code above in your browser using DataLab