getSRPars | R Documentation |
This function samples relevant stock-recruit parameters from a dataframe containing posterior samples from MCMC sampling. Sampling is based on percentile arguments.
getSRPars(pars, alphaOnly = TRUE, highP = 0.9, lowP = 0.1, stks = NULL)
pars |
A dataframe containing stock-recruit parameters. Should be
formatted so that stock/population ( |
alphaOnly |
A logical argument. If TRUE then percentiles are only used for alpha parameter, all others use medians. If FALSE then percentiles are calculated and returned for all parameters. |
highP , lowP |
Numerics that represent high and low percentiles that are being estimated. |
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. |
Returns a list of length three (pLow, pMed, pHigh
) containing
lower percentiles, medians and higher percentiles, respectively. Note that
if alphaOnly = TRUE, the same median values will be returned for non-alpha
parameters in all list elements.
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
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.