TimeToTargetRunSize {BTSPAS}R Documentation

Computes and plots posterior distribution of time to get target run size. For example, the time to reach a cumulative run of 10,000 fish.

Description

Takes a sim.list object from the MCMC runs, computes the posterior distribution of the time to the target runsize, plots the posterior #'

Usage

TimeToTargetRunSize(U, time, targetU, file_prefix, ci_prob = 0.95)

Arguments

U

Elements of sim.list from MCMC object for U - the estimate runsize in each stratum

time

A numeric vector of time used to label the strata. For example, this could be julian week for data stratified at a weekly level.

targetU

The targeted cumulative run size. E.g. 10,000

file_prefix

Character string giving prefix for plot. A plot will be produced of the posterior in the filename paste(file_prefix,"-target.pdf",sep="")).

ci_prob

What size of credible interval should be computed?

Value

A list with a sample of the posterior (index), quantiles (quantiles), mean (mean), median(median), and standard deviation (sd), and target value (targetU)

Author(s)

Bonner, S.J. sbonner6@uwo.ca and Schwarz, C. J. cschwarz.stat.sfu.ca@gmail.com.

Examples

 
## Not run: 
# Compute the posterior of time to reach 10,000 fish. Results contains the MCMC object
# 
results$TimeToTargetRunSize <- TimeToTargetRunSize( 
        U=results$sims.list$U,
        time=results$data$time,
        targetU=10000,
        file_prefix = 'Time10000')


## End(Not run) # end of dontrun


[Package BTSPAS version 2024.5.9 Index]