Learn R Programming

gamsel (version 1.8-5)

pseudo.bases: Generate pseudo-spline bases

Description

Generate an approximation to the Demmler-Reinsch orthonormal bases for smoothing splines, using orthogonal polynomials. basis.gen generates a basis for a single x, and pseudo.bases generates a list of bases for each column of the matrix x.

Usage

pseudo.bases(x, degree = 8, df = 6, parallel = FALSE, ...)

Value

An orthonormal basis is returned (a list for pseudo.bases). This has an attribute parms, which has elements coefsCoefficients needed to generate the orthogonal polynomials rotateTransformation matrix for transforming the polynomial basis dpenalty values for the diagonal penalty dfdf used degreenumber of columns

Arguments

x

A vector of values for basis.gen, or a matrix for pseudo.bases

degree

The nominal number of basis elements. The basis returned has no more than degree columns. For pseudo.bases this can be a single value or a vector of values, which are recycled sequentially for each column of x

df

The degrees of freedom of the smoothing spline.

parallel

if TRUE, parallelize

...

other arguments for basis.gen can be passed through to [basis.gen]

Author

Alexandra Chouldechova and Trevor Hastie
Maintainer: Trevor Hastie hastie@stanford.edu

Details

basis.gen starts with a basis of orthogonal polynomials of total degree. These are each smoothed using a smoothing spline, which allows for a one-step approximation to the Demmler-Reinsch basis for a smoothing spline of rank equal to the degree. See the reference for details. The function also approximates the appropriate diagonal penalty matrix for this basis, so that the a approximate smoothing spline (generalized ridge regression) has the target df.

References

T. Hastie Pseudosplines. (1996) JRSSB 58(2), 379-396.
Chouldechova, A. and Hastie, T. (2015) Generalized Additive Model Selection

Examples

Run this code

##data=gamsel:::gendata(n=500,p=12,k.lin=3,k.nonlin=3,deg=8,sigma=0.5)
data = readRDS(system.file("extdata/gamsel_example.RDS", package = "gamsel"))
attach(data)
bases=pseudo.bases(X,degree=10,df=6)
if (FALSE) {
     require(doMC)
     registerDoMC(cores=4)
     bases=pseudo.bases(X,degree=10,df=6,parallel=TRUE)
}

Run the code above in your browser using DataLab