bootstrap {sojourner} | R Documentation |
Bootstrap confidience intervals with standard errors. bootstrap resamples dataset (e.g. diffusion coefficients) to calculate confidience intervals for a statistic measure of dataset.
bootstrap(fittedObj,n.reps=100)
n.reps |
number of replicates for bootstrapping |
fittedObj |
output from fitNormDistr |
A wrapper of boot::boot and mixtools::boot.se adapted for data format in sojourner package. Also returns stderr information by running boot.se from mixtools and an additional method for one-component distribution calculates the stderr separately. For multi-component distributions, the boot.se function from the mixtools package was used. For single-component distributions, a separate function was used to calculate the stderr and confidence interval.
List of length 2 containing:
Fit results from fitNormDistr that was used as the input for the function
Bootstraps results from bootstrapping. mean values of each samples, standard error for the mean, lambda
# read in track files folder=system.file('extdata','SWR1',package='sojourner') trackll=createTrackll(folder=folder, input = 3) # filter track based length trackll.flt=filterTrack(trackll,filter=c(min=5,max=Inf)) MSD=msd(trackll.flt,dt=6,summarize=FALSE,plot=TRUE) dcoef=Dcoef(MSD=MSD,method='static',plot=FALSE) # fit the dcoef result fittedObj=fitNormDistr(dcoef) # bootstrap new datasets d.boot=bootstrap(fittedObj) # manually set the number of bootstrap samples to 50 d.boot=bootstrap(fittedObj, n.reps=50)