spadd.presmth.Legr: Fit the desparsified lasso presmoothing estimator with...

View source: R/spaddinf.R

spadd.presmth.LegrR Documentation

Fit the desparsified lasso presmoothing estimator with Legendre polynomials

Description

Fit the desparsified lasso presmoothing estimator with Legendre polynomials

Usage

spadd.presmth.Legr(X, Y, d.pre, lambda, eta, n.foi, K = 1)

Arguments

X

the design matrix

Y

the response vector

d.pre

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

lambda

the tuning parameter for fitting the group lasso estimate for the bias correction

eta

the tuning parameter for the group lasso projection of one set of basis functions onto those of the other covariates.

n.foi

the number of functions (first columns of X) for which to compute the desparsified lasso presmoothing estimator.

K

the order of the Legendre polynomials. E.g. K=0 fits piecwise constant, K=1 fits piecewise linear functions.

Value

a list with the fitted functions etc.

Examples

data <- data_gen(n = 100,q = 10,r = .5)

spadd.presmth.Legr.out <- spadd.presmth.Legr(X = data$X,
                                             Y = data$Y,
                                             d.pre = 10,
                                             lambda = .1,
                                             eta = 2,
                                             n.foi = 6,
                                             K = 1)

plot_presmth_Legr(x = spadd.presmth.Legr.out,
                  true.functions = list( f = data$f, X = data$X))

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