R/AdaptiveReg.R

Defines functions AdaptiveReg

Documented in AdaptiveReg

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)
}
fhebert/AdaptivePrediction documentation built on Nov. 4, 2019, 12:40 p.m.