Non-Parametric population samples and statistic comparison
Random populations are generated via ressampling using the suplied population. A statistic is calculated on the random population and compared to the statistic calculated on the original population.
BootstrapStat( ind.data, iterations, ComparisonFunc, StatFunc, sample.size = dim(ind.data)[1], parallel = FALSE )
ind.data
: Matrix of residuals or indiviual measurmentsiterations
: Number of resamples to takeComparisonFunc
: comparison functionStatFunc
: Function for calculating the statisticsample.size
: Size of ressamples, default is the same size as ind.dataparallel
: if TRUE computations are done in parallel. Some foreach backend must be registered, like doParallel or doMC.returns the mean repeatability, that is, the mean value of comparisons from samples to original statistic.
cov.matrix <- RandomMatrix(5, 1, 1, 10) BootstrapStat(iris[,1:4], iterations = 50, ComparisonFunc = function(x, y) PCAsimilarity(x, y)[1], StatFunc = cov) #Calculating R2 confidence intervals r2.dist <- BootstrapR2(iris[,1:4], 30) quantile(r2.dist) #Multiple threads can be used with some foreach backend library, like doMC or doParallel #library(doParallel) ##Windows: #cl <- makeCluster(2) #registerDoParallel(cl) ##Mac and Linux: #registerDoParallel(cores = 2) #BootstrapStat(iris[,1:4], iterations = 100, # ComparisonFunc = function(x, y) KrzCor(x, y)[1], # StatFunc = cov, # parallel = TRUE)
BootstrapRep
, AlphaRep
Diogo Melo, Guilherme Garcia
Useful links