# Generate Data
set.seed(10)
n <- 200
beta <- c(1,1,rep(0,8))
X <- mvtnorm::rmvnorm(n,sigma=diag(1,10))
eps <- rnorm(n)
Y <- (X%*%beta)**3+eps
# Apply SIR with soft thresholding
res = SIR_threshold_opt(Y,X,H=10,n_lambda=100,thresholding="soft")
# Estimated index versus Y
plot(res,choice="estim_ind")
# Choice of optimal lambda
plot(res,choice="opt_lambda")
# Evolution of cos^2 and var selection according to lambda
plot(res,choice="cos2_selec")
# Regularization path
plot(res,choice="regul_path")
Run the code above in your browser using DataLab