getSRPars_randomSamp: Sample stock-recruit parameters from posterior distribution

View source: R/getSRPars_randomSamp.R

getSRPars_randomSampR Documentation

Sample stock-recruit parameters from posterior distribution

Description

This function samples relevant stock-recruit parameters from a dataframe containing posterior samples from MCMC sampling. Sampling among MCMC replicates is random with replacement.

Usage

getSRPars_randomSamp(pars, stks = NULL)

Arguments

pars

A dataframe containing stock-recruit parameters. Should be formatted so that stock/population (stk) is in first column and each subsequent column contains one parameter; each row represents one posterior sample.

stks

A vector that is used to identify a subset of stocks for which parameters are returned. Can be either a numeric or character, but should match the format of the first column of the input dataframe.

Value

Returns a data frame with SR parameters for each stock that come from a single, randomly sampled MCMC replicate.Each row in the data frame represents a stock.

Examples

head(rickerParameters)
d <- getSRPars(rickerParameters, alphaOnly = FALSE)
head(d$pLow) #lower percentile estimates
head(d$pMed) #median estimates

d <- getSRPars(larkinParameters, alphaOnly = TRUE)
head(d$pLow) #lower percentile estimates for alpha only

CamFreshwater/samSim documentation built on Sept. 25, 2023, 10:22 a.m.