This function performs block bootstrapping on a given dataset.
Usage
bootstrap_block(data, k = 14)
Arguments
- data
Data frame of raw data detrended if necessary. First column should be of the Date
.
- k
Numeric vector of length one specifying the block length. Default is 14
.
Value
Dataframe containing th eblock bootstap sample.
Examples
#Boostrap the detrended data at site S-22
boot_df = bootstrap_block(S22.Detrend.df[,2:3])
#Calculate the mean of the drivers in bootstrapped sample
apply(boot_df,2,function(x) mean(x,na.rm=TRUE))
#> [1] 0.1677406 2.2850277