Title: | S-LASSO Estimator for the Function-on-Function Linear Regression |
---|---|
Description: | Implements the smooth LASSO estimator for the function-on-function linear regression model described in Centofanti et al. (2020) <arXiv:2007.00529>. |
Authors: | Fabio Centofanti [cre, aut], Antonio Lepore [aut], Simone Vantini [aut], Matteo Fontana [aut] |
Maintainer: | Fabio Centofanti <[email protected]> |
License: | GPL (>= 3) |
Version: | 1.0.0.9000 |
Built: | 2025-01-31 04:40:24 UTC |
Source: | https://github.com/unina-sfere/slasso |
Implements the Smooth LASSO Estimator for the Function-on-Function Linear Regression Model described in Centofanti et al. (2020) <arXiv:2007.00529>.
Package: | slasso |
Type: | Package |
Version: | 1.0.0 |
Date: | 2021-10-13 |
License: | GPL (>= 3) |
Fabio Centofanti, Matteo Fontana, Antonio Lepore, Simone Vantini
Centofanti, F., Fontana, M., Lepore, A., & Vantini, S. (2020). Smooth LASSO Estimator for the Function-on-Function Linear Regression Model. arXiv preprint arXiv:2007.00529.
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_cv<-slasso.fr_cv(Y_fd = Y_fd,X_fd=X_fd,basis_s=basis_s,basis_t=basis_t, lambda_L_vec = 10^seq(0,1,by=1),lambda_s_vec = 10^-9,lambda_t_vec = 10^-7, B0=NULL,max_iterations=10,K=2,invisible=1,ncores=1) mod_slasso<-slasso.fr(Y_fd = Y_fd,X_fd=X_fd,basis_s=basis_s,basis_t=basis_t, lambda_L = 10^0.7,lambda_s =10^-5,lambda_t = 10^-6,B0 =NULL,invisible=1,max_iterations=10) plot(mod_slasso_cv) plot(mod_slasso)
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_cv<-slasso.fr_cv(Y_fd = Y_fd,X_fd=X_fd,basis_s=basis_s,basis_t=basis_t, lambda_L_vec = 10^seq(0,1,by=1),lambda_s_vec = 10^-9,lambda_t_vec = 10^-7, B0=NULL,max_iterations=10,K=2,invisible=1,ncores=1) mod_slasso<-slasso.fr(Y_fd = Y_fd,X_fd=X_fd,basis_s=basis_s,basis_t=basis_t, lambda_L = 10^0.7,lambda_s =10^-5,lambda_t = 10^-6,B0 =NULL,invisible=1,max_iterations=10) plot(mod_slasso_cv) plot(mod_slasso)
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.
## S3 method for class 'slasso_cv' plot(x, ...) ## S3 method for class 'slasso' plot(x, ...)
## S3 method for class 'slasso_cv' plot(x, ...) ## S3 method for class 'slasso' plot(x, ...)
x |
The output of either |
... |
No additional parameters, called for side effects. |
No return value, called for side effects.
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)
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)
Generate synthetic data as in the simulation study of Centofanti et al. (2020).
simulate_data(scenario, n_obs = 3000, type_x = "Bspline")
simulate_data(scenario, n_obs = 3000, type_x = "Bspline")
scenario |
A character strings indicating the scenario considered. It could be "Scenario I", "Scenario II", "Scenario III", and "Scenario IV". |
n_obs |
Number of observations. |
type_x |
Covariate generating mechanism, either Bspline or Brownian. |
A list containing the following arguments:
X
: Covariate matrix, where the rows correspond to argument values and columns to replications.
Y
: Response matrix, where the rows correspond to argument values and columns to replications.
X_fd
: Coavariate functions.
Y_fd
: Response functions.
clus
: True cluster membership vector.
Centofanti, F., Fontana, M., Lepore, A., & Vantini, S. (2020). Smooth LASSO Estimator for the Function-on-Function Linear Regression Model. arXiv preprint arXiv:2007.00529.
library(slasso) data<-simulate_data("Scenario II",n_obs=150)
library(slasso) data<-simulate_data("Scenario II",n_obs=150)
The smooth LASSO (S-LASSO) method for the function-on-function linear regression model provides interpretable coefficient function estimates that are both locally sparse and smooth (Centofanti et al., 2020).
slasso.fr( Y_fd, X_fd, basis_s, basis_t, lambda_L, lambda_s, lambda_t, B0 = NULL, ... )
slasso.fr( Y_fd, X_fd, basis_s, basis_t, lambda_L, lambda_s, lambda_t, B0 = NULL, ... )
Y_fd |
An object of class fd corresponding to the response functions. |
X_fd |
An object of class fd corresponding to the covariate functions. |
basis_s |
B-splines basis along the |
basis_t |
B-splines basis along the |
lambda_L |
Regularization parameter of the functional LASSO penalty. |
lambda_s |
Regularization parameter of the smoothness penalty along the |
lambda_t |
Regularization parameter of the smoothness penalty along the |
B0 |
Initial estimator of the basis coefficients matrix of the coefficient function. Should have dimensions in accordance with the basis dimensions of |
... |
Other arguments to be passed to the Orthant-Wise Limited-memory Quasi-Newton optimization function. See the |
A list containing the following arguments:
B
: The basis coefficients matrix estimate of the coefficient function.
Beta_hat_fd
: The coefficient function estimate of class bifd.
alpha
: The intercept function estimate.
lambdas_L
: Regularization parameter of the functional LASSO penalty.
lambda_s
: Regularization parameter of the smoothness penalty along the s
-direction.
lambda_t
: Regularization parameter of the smoothness penalty along the t
-direction.
Y_fd
: The response functions.
X_fd
: The covariate functions.
per_0
: The fraction of domain where the coefficient function is zero.
type
: The output type.
Centofanti, F., Fontana, M., Lepore, A., & Vantini, S. (2020). Smooth LASSO Estimator for the Function-on-Function Linear Regression Model. arXiv preprint arXiv:2007.00529.
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)
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)
K-fold cross-validation procedure to choose the tuning parameters for the S-LASSO estimator (Centofanti et al., 2020).
slasso.fr_cv( Y_fd, X_fd, basis_s, basis_t, K = 10, kss_rule_par = 0.5, lambda_L_vec = NULL, lambda_s_vec = NULL, lambda_t_vec = NULL, B0 = NULL, ncores = 1, ... )
slasso.fr_cv( Y_fd, X_fd, basis_s, basis_t, K = 10, kss_rule_par = 0.5, lambda_L_vec = NULL, lambda_s_vec = NULL, lambda_t_vec = NULL, B0 = NULL, ncores = 1, ... )
Y_fd |
An object of class fd corresponding to the response functions. |
X_fd |
An object of class fd corresponding to the covariate functions. |
basis_s |
B-splines basis along the |
basis_t |
B-splines basis along the |
K |
Number of folds. Default is 10. |
kss_rule_par |
Parameter of the |
lambda_L_vec |
Vector of regularization parameters of the functional LASSO penalty. |
lambda_s_vec |
Vector of regularization parameters of the smoothness penalty along the |
lambda_t_vec |
Vector of regularization parameters of the smoothness penalty along the |
B0 |
Initial estimator of the basis coefficients matrix of the coefficient function. Should have dimensions in accordance with the basis dimensions of |
ncores |
If |
... |
Other arguments to be passed to the Orthant-Wise Limited-memory Quasi-Newton optimization function. See the |
A list containing the following arguments:
lambda_opt_vec
: Vector of optimal tuning parameters.
CV
: Estimated prediction errors.
CV_sd
: Standard errors of the estimated prediction errors.
per_0
: The fractions of domain where the coefficient function is zero for all the tuning parameters combinations.
comb_list
: The combinations of lambda_L
,lambda_s
and lambda_t
explored.
Y_fd
: The response functions.
X_fd
: The covariate functions.
Centofanti, F., Fontana, M., Lepore, A., & Vantini, S. (2020). Smooth LASSO Estimator for the Function-on-Function Linear Regression Model. arXiv preprint arXiv:2007.00529.
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<-60 n_basis_t<-60 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_cv<-slasso.fr_cv(Y_fd = Y_fd,X_fd=X_fd,basis_s=basis_s,basis_t=basis_t, lambda_L_vec=seq(0,1,by=1),lambda_s_vec=c(-9),lambda_t_vec=-7,B0=NULL, max_iterations=10,K=2,invisible=1,ncores=1)
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<-60 n_basis_t<-60 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_cv<-slasso.fr_cv(Y_fd = Y_fd,X_fd=X_fd,basis_s=basis_s,basis_t=basis_t, lambda_L_vec=seq(0,1,by=1),lambda_s_vec=c(-9),lambda_t_vec=-7,B0=NULL, max_iterations=10,K=2,invisible=1,ncores=1)