AdaptiveReg = function(x,y,nvmax=NULL,nfolds=10){
if((nfolds<3)||(nfolds>length(y))){
stop("Error, nfolds must be between 3 and n")
}
dta = list(x=x,y=y)
res.ZgMoments = ZgMoments(dta)
resCV = CVOptNv(dta,nfolds,nvmax)
nv = resCV$nv
R2 = resCV$R2
res = list(ZgMoments=res.ZgMoments,nv=nv,R2=R2)
return(res)
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.