Learn R Programming

SISIR (version 0.2.3)

tune.ridgeSIR: Cross-Validation for ridge SIR

Description

tune.ridgeSIR performs a Cross Validation for ridge SIR estimation

Usage

tune.ridgeSIR(
  x,
  y,
  listH,
  list_mu2,
  list_d,
  nfolds = 10,
  parallel = TRUE,
  ncores = NULL
)

Value

a data frame with tested parameters and corresponding CV error and estimation of R(d)

Arguments

x

explanatory variables (numeric matrix or data frame)

y

target variable (numeric vector)

listH

list of the number of slices to be tested (numeric vector)

list_mu2

list of ridge regularization parameters to be tested (numeric vector)

list_d

list of the dimensions to be tested (numeric vector)

nfolds

number of folds for the cross validation. Default is 10

parallel

whether the computation should be performed in parallel or not. Logical. Default is FALSE

ncores

number of cores to use if parallel = TRUE. If left to NULL, all available cores minus one are used

Author

Victor Picheny, victor.picheny@inrae.fr
Remi Servien, remi.servien@inrae.fr
Nathalie Vialaneix, nathalie.vialaneix@inrae.fr

References

Picheny, V., Servien, R. and Villa-Vialaneix, N. (2016) Interpretable sparse SIR for digitized functional data. Statistics and Computing, 29(2), 255--267.

See Also

ridgeSIR

Examples

Run this code
set.seed(1115)
tsteps <- seq(0, 1, length = 200)
nsim <- 100
simulate_bm <- function() return(c(0, cumsum(rnorm(length(tsteps)-1, sd=1))))
x <- t(replicate(nsim, simulate_bm()))
beta <- cbind(sin(tsteps*3*pi/2), sin(tsteps*5*pi/2))
y <- log(abs(x %*% beta[ ,1])) + sqrt(abs(x %*% beta[ ,2]))
y <- y + rnorm(nsim, sd = 0.1)
list_mu2 <- 10^(0:10)
listH <- c(5, 10)
list_d <- 1:4
set.seed(1129)
# \donttest{
res_tune <- tune.ridgeSIR(x, y, listH, list_mu2, list_d, nfolds = 10, 
                          parallel = TRUE, ncores = 2)# }

Run the code above in your browser using DataLab