plot.slasso {slasso}R Documentation

Plot the results of the S-LASSO method

Description

This function provides plots of the S-LASSO coefficient function estimate when applied to the output of slasso.fr, whereas provides the cross-validation plots when applied to the output of slasso.fr_cv. In the latter case the first plot displays the CV values as a function of lambda_L, lambda_s and lambda_t, and the second plot displays the CV values as a function of lambda_L with lambda_s and lambda_t fixed at their optimal values.

Usage

## S3 method for class 'slasso_cv'
plot(x, ...)

## S3 method for class 'slasso'
plot(x, ...)

Arguments

x

The output of either slasso.fr_cv or slasso.fr.

...

No additional parameters, called for side effects.

Value

No return value, called for side effects.

Examples

library(slasso)
data<-simulate_data("Scenario II",n_obs=150)
X_fd=data$X_fd
Y_fd=data$Y_fd
domain=c(0,1)
n_basis_s<-30
n_basis_t<-30
breaks_s<-seq(0,1,length.out = (n_basis_s-2))
breaks_t<-seq(0,1,length.out = (n_basis_t-2))
basis_s <- fda::create.bspline.basis(domain,breaks=breaks_s)
basis_t <- fda::create.bspline.basis(domain,breaks=breaks_t)
mod_slasso<-slasso.fr(Y_fd = Y_fd,X_fd=X_fd,basis_s=basis_s,basis_t=basis_t,
lambda_L = -1.5,lambda_s =-8,lambda_t = -7,B0 =NULL,invisible=1,max_iterations=10)
plot(mod_slasso)

[Package slasso version 1.0.0 Index]