## Use the method on a simulated data set
set.seed(79)
n <- 100; p <- 50
## Simulate design matrix and response
x <- matrix(runif(n * p, min = -2.5, max = 2.5), nrow = n, ncol = p)
y <- scale(3 * (x[,1]> 0), scale=FALSE) + x[,2]^3 + rnorm(n)
## Do CV
CVobj <- cv.liso(x,y, K=10, plot.it=TRUE)
## Do the actual fit
fitobj <- liso.backfit(x,y,CVobj$optimlam)
plot(fitobj)
Run the code above in your browser using DataLab