| pseudo.bases | R Documentation |
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.
pseudo.bases(x, degree = 8, df = 6, parallel = FALSE, ...)
x |
A vector of values for |
degree |
The nominal number of basis elements. The basis returned has
no more than |
df |
The degrees of freedom of the smoothing spline. |
parallel |
if TRUE, parallelize |
... |
other arguments for |
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.
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
Alexandra Chouldechova and Trevor Hastie
Maintainer: Trevor
Hastie hastie@stanford.edu
T. Hastie Pseudosplines. (1996) JRSSB 58(2), 379-396.
Chouldechova, A. and Hastie, T. (2015) Generalized Additive Model
Selection
##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)
## Not run:
require(doMC)
registerDoMC(cores=4)
bases=pseudo.bases(X,degree=10,df=6,parallel=TRUE)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.