spadd.presmth.Bspl.cv: Choose tuning parameters of desparsified lasso presmoothing...

View source: R/spaddinf.R

spadd.presmth.Bspl.cvR Documentation

Choose tuning parameters of desparsified lasso presmoothing estimator with cubic B-splines

Description

Choose tuning parameters of desparsified lasso presmoothing estimator with cubic B-splines

Usage

spadd.presmth.Bspl.cv(X, Y, d.pre, n.lambda, n.eta, n.folds, plot = FALSE)

Arguments

X

the design matrix

Y

the response vector

d.pre

the number of intervals in which to divide the support of each covariate

n.lambda

the number of candidate lambda values

n.eta

the number of candidate eta values

n.folds

the number of crossvalidation folds

Value

a list with the chosen values of the tuning parameters

Examples

data <- data_gen(n = 200,q = 50,r = .9)

spadd.presmth.Bspl.cv.out <- spadd.presmth.Bspl.cv(X = data$X,
                                                   Y = data$Y,
                                                   d.pre = 20,
                                                   n.lambda = 25,
                                                   n.eta = 25,
                                                   n.folds = 5,
                                                   plot = TRUE)

spadd.presmth.Bspl.out <- spadd.presmth.Bspl(X = data$X,
                                             Y = data$Y,
                                             d.pre = 20,
                                             lambda = spadd.presmth.Bspl.cv.out$cv.lambda,
                                             eta = spadd.presmth.Bspl.cv.out$cv.eta,
                                             n.foi = 6)

plot_presmth_Bspl(spadd.presmth.Bspl.out)

gregorkb/spaddinf documentation built on Oct. 29, 2024, 3:17 p.m.