project | R Documentation |
This function can be used to project the default bdm model forward in time assuming a constant catch (harvest) or harvest rate. Multiple alternative scenarios can be run simultaneously.
project(object, harvest.project, ...)
## S4 method for signature 'bdm,vector'
project(object, harvest.project, time.project, harvest_rate = TRUE)
object |
a |
harvest.project |
a constant harvest or harvest rate as a vector across alternative scenarios |
time.project |
number of time steps for future projection |
harvest_rate |
a |
Model parameter values are sampled from the joint posterior distribution and a projection is performed for each sample. A correlated random walk of process error terms is assumed during the projection.
Returns a list
containing the elements:
run
optional run label that will match the corresponding object@run
scenarios
vector of harvest or harvest rate scenarios
time
complete series of time step labels
nsamples
number of posterior samples equal to object@nsamples
biomass
array of biomass values with dimensions: iteration, time, scenario
depletion
array of depletion values with dimensions: iteration, time, scenario
epsilon_p
process error residual matrix
harvest
catch time series array
harvest_rate
harvest rate time series array
## Not run:
# get some data
data(haknz)
dat <- bdmData(harvest = haknz$landings, index = cbind(haknz$survey, haknz$cpue))
# initialize and fit default model
mdl <- bdm()
mdl <- compiler(mdl)
mdl <- sampler(mdl, dat, run = 'example_run')
# constant harvest rate projection scenarios
mdl.project <- project(mdl, harvest = c(0.05, 0.10, 0.15), time = 20, harvest_rate = TRUE)
# check label
mdl@run
mdl.project$run
# extract median values
apply(mdl.project$depletion, 2:3, median)
apply(mdl.project$harvest, 2:3, median)
apply(mdl.project$harvest_rate, 2:3, median)
# constant catch projection scenarios
mdl.project <- project(mdl, harvest = c(900, 1200, 1500), time = 20, harvest_rate = FALSE)
# extract median values
apply(mdl.project$depletion, 2:3, median)
apply(mdl.project$harvest, 2:3, median)
apply(mdl.project$harvest_rate, 2:3, median)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.