p=10
n=200
d=5
coefs=c(3,1.5,0,0,2)
intercept=0
beta=rep(0,p)
beta[1:d]=coefs
X=matrix(rnorm(p*n), nrow=n)
mu=1/(1+exp(-X %*% beta-intercept))
y=rbinom(n,1,mu)
fit.cv=cv.apple(X, y, family="binomial", alpha=0.25, K=5)
plot(fit.cv)
Run the code above in your browser using DataLab