importMCMC: Import Coleraine MCMC Results

View source: R/importMCMC.R

importMCMCR Documentation

Import Coleraine MCMC Results

Description

Import Coleraine MCMC traces for likelihoods, parameters, spawning biomass, and recruitment.

Usage

importMCMC(dir, coda=FALSE, quiet=TRUE, pretty.labels=FALSE,
           l.choose=NULL, p.choose=NULL)

Arguments

dir

directory containing the files ‘mcmclike.out’, ‘params.pst’, ‘spawbiom.pst’ and ‘recruits.pst’.

coda

whether data frames should be coerced to class mcmc using the coda package.

quiet

whether to report progress while parsing files in directory.

pretty.labels

whether likelihood and parameter columns should be renamed

l.choose

vector of strings, indicating which likelihood components to import, or NULL to import all.

p.choose

vector of strings, indicating which parameters to import, or NULL to import all.

Value

A list containing:

L

likelihoods

P

parameters

B

biomass by year

R

recruitment by year

as data frames, or mcmc objects if coda=TRUE.

Note

The functions ll (package gdata) and head are recommended for browsing nested objects, e.g. ll(xmcmc), ll(xmcmc$P), and head(xmcmc$P).

The plotMCMC package is recommended for plotting MCMC diagnostics and posteriors.

References

Hilborn, R., Maunder, M., Parma, A., Ernst, B., Payne, J., and Starr, P. (2003). Coleraine: A generalized age-structured stock assessment model. User's manual version 2.0. University of Washington Report SAFS-UW-0116.

See Also

read.table, readLines, and scan import any data.

importMCMC and importProj import Coleraine MCMC results.

xmcmc was created using importMCMC.

scape-package gives an overview of the package.

Examples

path <- system.file("example/mcmc", package="scape")
mcmc <- importMCMC(path)  # or rename and select particular elements:
mcmc <- importMCMC(path, pretty.labels=TRUE,
                   l.choose=c("CAc","CAs","Survey","Prior","Total"),
                   p.choose=c("R0","Rinit","uinit","cSleft","cSfull",
                              "sSleft","sSfull","logq"))

arnima-github/scape documentation built on Jan. 17, 2024, 2:39 p.m.