MyNixOS website logo
Description

S-LASSO Estimator for the Function-on-Function Linear Regression.

Implements the smooth LASSO estimator for the function-on-function linear regression model described in Centofanti et al. (2022) <doi:10.1016/j.csda.2022.107556>.

slasso

R buildstatus CRANstatus R-CMD-check

The package slasso implements the smooth LASSO estimator (S-LASSO) for the Function-on-Function linear regression model proposed by Centofanti et al. (2022). The S-LASSO estimator is able to increase the interpretability of the model, by better locating regions where the coefficient function is zero, and to smoothly estimate non-zero values of the coefficient function. The sparsity of the estimator is ensured by a functional LASSO penalty, which pointwise shrinks toward zero the coefficient function, while the smoothness is provided by two roughness penalties that penalize the curvature of the final estimator. The package comprises two main functions slasso.fr and slasso.fr_cv. The former implements the S-LASSO estimator for fixed tuning parameters of the smoothness penalties $\lambda_s$ and $\lambda_t$, and tuning parameter of the functional LASSO penalty $\lambda_L$. The latter executes the K-fold cross-validation procedure described in Centofanti et al. (2022) to choose $\lambda_L$, $\lambda_s$, and $\lambda_t$.

Installation

The development version can be installed from GitHub with:

# install.packages("devtools")
devtools::install_github("unina-sfere/slasso")

Example

This is a basic example which shows you how to apply the two main functions slasso.fr and slasso.fr_cv on a synthetic dataset generated as described in the simulation study of Centofanti et al. (2022).

We start by loading and attaching the slasso package.

library(slasso)

Then, we generate the synthetic dataset and build the basis function sets as follows.

data<-simulate_data("Scenario II",n_obs=500)
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)

To apply slasso.fr_cv, sequences of $\lambda_L$, $\lambda_s$, and $\lambda_t$ should be defined.

lambda_L_vec=10^seq(0,1,by=0.1) 
lambda_s_vec=10^seq(-6,-5) 
lambda_t_vec=10^seq(-5,-5) 

And, then, slasso.fr_cv is executed.

mod_slasso_cv<-slasso.fr_cv(Y_fd = Y_fd,X_fd=X_fd,basis_s=basis_s,basis_t=basis_t,
lambda_L_vec = lambda_L_vec,lambda_s_vec = lambda_s_vec,lambda_t_vec =lambda_t_vec,
max_iterations=1000,K=10,invisible=1,ncores=12)

The results are plotted.

plot(mod_slasso_cv)

By using the model selection method described in Centofanti et al. (2022), the optimal values of $\lambda_L$, $\lambda_s$, and $\lambda_t$, are $3.98$, $10^{-5}$, and $10^{-5}$, respectively.

Finally, sasfclust is applied with $\lambda_L$, $\lambda_s$, and $\lambda_t$ fixed to their optimal values.

mod_slasso<-slasso.fr(Y_fd = Y_fd,X_fd=X_fd,basis_s=basis_s,basis_t=basis_t,
lambda_L = mod_slasso_cv$lambda_opt_vec[1],lambda_s = mod_slasso_cv$lambda_opt_vec[2],
lambda_t =  mod_slasso_cv$lambda_opt_vec[3],invisible=1,max_iterations=1000)

The resulting estimator is plotted as follows.

plot(mod_slasso)

References

  • Centofanti, F., Fontana, M., Lepore, A., & Vantini, S. (2022). Smooth lasso estimator for the function-on-function linear regression model. Computational Statistics & Data Analysis, 176, 107556.
Metadata

Version

1.0.1

License

Unknown

Platforms (79)

    Darwin
    FreeBSD
    Genode
    GHCJS
    Linux
    MMIXware
    NetBSD
    none
    OpenBSD
    Redox
    Solaris
    uefi
    wasip1
    Windows
Show all
  • aarch64-darwin
  • aarch64-freebsd
  • aarch64-genode
  • aarch64-linux
  • aarch64-netbsd
  • aarch64-none
  • aarch64-uefi
  • aarch64-windows
  • aarch64_be-none
  • arc-linux
  • arm-none
  • armv5tel-linux
  • armv6l-linux
  • armv6l-netbsd
  • armv6l-none
  • armv7a-linux
  • armv7a-netbsd
  • armv7l-linux
  • armv7l-netbsd
  • avr-none
  • i686-cygwin
  • i686-freebsd
  • i686-genode
  • i686-linux
  • i686-netbsd
  • i686-none
  • i686-openbsd
  • i686-windows
  • javascript-ghcjs
  • loongarch64-linux
  • m68k-linux
  • m68k-netbsd
  • m68k-none
  • microblaze-linux
  • microblaze-none
  • microblazeel-linux
  • microblazeel-none
  • mips-linux
  • mips-none
  • mips64-linux
  • mips64-none
  • mips64el-linux
  • mipsel-linux
  • mipsel-netbsd
  • mmix-mmixware
  • msp430-none
  • or1k-none
  • powerpc-linux
  • powerpc-netbsd
  • powerpc-none
  • powerpc64-linux
  • powerpc64le-linux
  • powerpcle-none
  • riscv32-linux
  • riscv32-netbsd
  • riscv32-none
  • riscv64-linux
  • riscv64-netbsd
  • riscv64-none
  • rx-none
  • s390-linux
  • s390-none
  • s390x-linux
  • s390x-none
  • sh4-linux
  • vc4-none
  • wasm32-wasip1
  • wasm64-wasip1
  • x86_64-cygwin
  • x86_64-freebsd
  • x86_64-genode
  • x86_64-linux
  • x86_64-netbsd
  • x86_64-none
  • x86_64-openbsd
  • x86_64-redox
  • x86_64-solaris
  • x86_64-uefi
  • x86_64-windows