fitSpline.cv: Fitting the optimal spline by cross validation method.

Description Usage Arguments Details Value

View source: R/SplineFit.R

Description

This function fits an optimal spline function to the given data set after choosing optimal degree of the polynomial and optimal number of knots by cross-validation.

Usage

1

Arguments

x

independent variable values.

y

dependent variable values

Details

The equation of a spline with degree p and q knots ξ_1, ξ_2, ..., ξ_q is

y = β_0 + β_1 * x + β_2 * x^2 + ... + β_p * x^p + γ_1 * (pos(x - ξ_1))^p + ... + γ_q * (pos(x - ξ_q))^p

where pos(u) = u * I(u > 0).

Value

A list containing the following objects.

f.hat

fitted values.

p

degree of the fitted polynomial.

q

number of knots.

beta

estimated coefficients of the polynomial.

gamma

estimated coefficients of the truncated polynomial.

knots

location of the knots.


rohosen/OBPSAE documentation built on May 17, 2019, 2:22 p.m.