importMCMC {scapeMCMC} | R Documentation |
Import Coleraine MCMC traces for likelihoods, parameters, spawning biomass, and recruitment.
importMCMC(dir, info="", coda=FALSE, quiet=TRUE, pretty.labels=FALSE, l.choose=NULL, p.choose=NULL)
dir |
directory containing the files ‘mcmclike.out’, ‘params.pst’, ‘spawbiom.pst’ and ‘recruits.pst’. |
info |
optional string containing information to store with MCMC results. |
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. |
A list containing:
L |
likelihoods |
P |
parameters |
B |
biomass by year |
R |
recruitment by year |
as data frames, or mcmc
objects if coda=TRUE
.
The example dataset xmcmc
was generated using
importMCMC
.
The functions ll
(package gdata) and head
are recommended for browsing MCMC results, e.g.
ll(xmcmc); ll(xmcmc$P); head(xmcmc$P)
.
Arni Magnusson arnima@u.washington.edu.
Hilborn, R., M. Maunder, A. Parma, B. Ernst, J. Payne, and P. Starr. 2003. Coleraine: A generalized age-structured stock assessment model. User's manual version 2.0. University of Washington Report SAFS-UW-0116. Available at http://fish.washington.edu/research/coleraine/coleraine.pdf.
importProj
, read.table
,
readLines
, scan
, xmcmc
.
scapeMCMC-package
gives an overview of the package.
## Not run: path <- paste(.find.package("scapeMCMC"), "/example", sep="") xmcmc <- importMCMC(path) # or rename and select particular elements: xmcmc <- importMCMC(path, pretty.labels=TRUE, l.choose=c("CAc","CAs","Survey","Prior","Total"), p.choose=c("R0","Rinit","uinit","cSleft","cSfull", "sSleft","sSfull","logq")) ## End(Not run)