coef.freekt: Compute Coefficients of B-Splines For Free-Knot Splines

Description Usage Arguments Value Author(s) See Also Examples

View source: R/Rfunc.R

Description

This function computes the coefficients of the B-splines for free-knot splines, given the amount of the penalty (if applicable) and the locations of the knots.

Usage

1
2
## S3 method for class 'freekt'
coef(object, ...)

Arguments

object

An object of class "freekt" obtained by using one of the fitting algorithms.

...

Additional arguments to be passed to coef.freekt. Currently ignored.

Value

A vector containing the coefficients of the B-splines.

Author(s)

Steven Spiriti

See Also

fitted.freekt to compute the fitted values and residuals.freekt to compute the residuals.

Examples

1
2
3
4
5
6
x <- 0:30/30
truey <- x*sin(10*x)
set.seed(10556)
y <- truey + rnorm(31, 0, 0.2)
xy.freekt <- freelsgen(x, y, degree = 2, numknot = 2, 555)
coef.freekt(xy.freekt)

Example output

Loading required package: splines
            [,1]
[1,] -0.09840307
[2,]  0.72986148
[3,] -1.12146577
[4,]  1.70394422
[5,] -0.84581683

freeknotsplines documentation built on May 2, 2019, 8:51 a.m.