TimeToTargetRunSize: Computes and plots posterior distribution of time to get...

Description Usage Arguments Value Author(s) Examples

View source: R/TimeToTargetRunSize.r

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

1
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

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
 
## 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

BTSPAS documentation built on Oct. 25, 2021, 9:07 a.m.