lnorm_vector_boot: Generating bootstrap vectors of with lognormal error

View source: R/lnorm_vector_boot.r

lnorm_vector_bootR Documentation

Generating bootstrap vectors of with lognormal error

Description

This function was designed to be used with time series of indices of abundance or removals. Based on code from previous BAM Monte-Carlo Bootstrap code

Usage

lnorm_vector_boot(x, cv, bootN = 1, standardize = FALSE, digits = NULL)

Arguments

x

observed vector

cv

observed cv for x

bootN

number of bootstrap replicates. Allows multiple bootstrapped vectors to be calculated without looping

standardize

divide resulting vectors by their own mean so that they have a mean of 1

digits

Number of significant digits to round output to. If NULL, output is not rounded.

Author(s)

Nikolai Klibansky, Kyle Shertzer, Erik Williams

Examples

## Not run: 
rdat <- rdat_VermilionSnapper
year <- rdat$t.series$year
U <- setNames(rdat$t.series$U.cHL.ob,year)
cv_U <- setNames(rdat$t.series$cv.U.cHL,year)
nsim <- 100
U_boot <- lnorm_vector_boot(U,cv_U,nsim)
dimnames(U_boot) <- list("year"=year,"sim"=sprintf(paste("%0",nchar(nsim),".0f",sep=""),1:nsim))
plot_boot_vec(t(U_boot))
points(as.numeric(year),U,type="o",col="blue")

## End(Not run)

nikolaifish/bamExtras documentation built on July 21, 2023, 8:26 a.m.