R/bootbagg.R

bootbagg<-function(dendat,seed,scatter=0)
{
set.seed(seed)
n<-dim(dendat)[1]
d<-dim(dendat)[2]
dendatout<-matrix(0,n,d)

for (i in 1:n){
   res<-ceiling(runif(1)*n)
   addi<-scatter*2*(runif(d)-0.5)
   dendatout[i,]<-dendat[res,]+addi
}

return(dendatout)
}

Try the delt package in your browser

Any scripts or data that you put into this service are public.

delt documentation built on May 2, 2019, 3:42 p.m.