bootASPM: bootASPM boostraps on the results of fitting an ASPM

View source: R/aspm.r

bootASPMR Documentation

bootASPM boostraps on the results of fitting an ASPM

Description

bootASPM uses the optimum parameters from fitting an ASPM to a set of data in a bootstrap process so as to provide 'iter' bootstrap replicate predicted CPUE trajectories. These can be used to generate estimates of the uncertainty around the predicted outcomes from the ASPM. The very first row of the results is the original predicted CPUE. The bootstraps are of the residuds between the observed and the predicted. The new bootstrap indices in each case are the combination of the original cpue series times the boostrapped residuals. 1000 bootstraps can take about 2 minutes.

Usage

bootASPM(infish, inglb, inprops, optpar, iter = 10, callfun = aspmLL)

Arguments

infish

the fish object from the fisheries data set

inglb

the globals 'glb' object from the fisheries data set

inprops

the properties 'props' object from the fisheries data set.

optpar

the optimum parameters obtained from fitting the ASPM

iter

how many bootstrap replicates are required? Defaults to 10 so that the bootstraps can be tested before running for, say, 1000 runs.

callfun

the function that is called to fit the model. Could be aspmLL, which is the default, or aspmPENLL, for three parameter models, or even aspmSSQ.

Value

a matrix of bootstrap replicate predicted CPUE vectors

Examples

## Not run: 
data(fishdat)
fish <- fishdat$fish
glb <- fishdat$glb
props <- fishdat$props
pars <- c(14,0.3)
bestL <- optim(pars,aspmLL,method="Nelder-Mead",infish=fish,inglb=glb,
               inprops=props,control=list(maxit = 1000, parscale = c(10,0.1)))
answer <- bootASPM(fish,glb,props,bestL$par,iter=10)
str(answer,max.level=1)
round(answer$result[,,"PredCE"],4) 

## End(Not run)  # infish=fish; inglb=glb; inprops=props; optpar=bestL$par;iter=10; callfun=aspmLL

haddonm/datalowSA documentation built on Nov. 5, 2023, 6:40 p.m.