| Bspl.cv | R Documentation | 
Choose number of basis functions in least squares B-splines via crossvalidation
Bspl.cv(Y, X, d.seq, n.folds, plot = FALSE)
| Y | a response vector (centered) | 
| X | vector of covariate observations | 
| d.seq | a sequence of candidate numbers of basis functions | 
| n.folds | the number of crossvalidation folds | 
| plot | a logical indicating whether to plot crossvalidation output | 
the number of basis functions selected by crossvalidation
data <- data_gen(n = 200,
                 q = 50,
                 r = .9)
cv.d <- Bspl.cv(Y = data$Y.oracle[,1],
                X = data$X[,1],
                d.seq = 3:12,
                n.folds = 5,
                plot = TRUE)
oracle.Bspl.out <- oracle.Bspl(Y = data$Y.oracle[,1],
                               X = data$X[,1],
                               d = cv.d,
                               plot = TRUE)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.