mcmc.out: Summarize, analyze and plot key MCMC output.

Description Usage Arguments Author(s) See Also Examples

View source: R/mcmc.out.R

Description

Makes four panel plot showing trace plots, moving average, autocorrelations, and densities for chosen parameters from MCMC output.

Usage

1
2
3
4
5
6
mcmc.out(directory = "c:/mydirectory/", run = "mymodel/",
  file = "keyposteriors.csv", namefile = "postplotnames.sso",
  names = FALSE, headernames = TRUE, numparams = 1, closeall = TRUE,
  burn = 0, thin = 1, scatter = FALSE, surface = FALSE, surf1 = 1,
  surf2 = 2, stats = FALSE, plots = TRUE, header = TRUE, sep = ",",
  print = FALSE, new = T, colNames = NULL)

Arguments

directory

Directory where all results are located, one level above directory for particular run.

run

Directory with files from a particular run.

file

File containing posterior samples for key parameters. This could be written by the function SSgetMCMC.

namefile

The (optional) file name of the dimension and names of posteriors.

names

Read in names file (T) or use generic naming (F).

headernames

Use the names in the header of file?

numparams

The number of parameters to analyze.

closeall

By default close all open devices.

burn

Optional burn-in value to apply on top of the option in the starter file and SSgetMCMC.

thin

Optional thinning value to apply on top of the option in the starter file, in the -mcsave runtime command, and in SSgetMCMC.

scatter

Can add a scatter-plot of all params at end, default is none.

surface

Add a surface plot of 2-way correlations.

surf1

The first parameter for the surface plot.

surf2

The second parameter for the surface plot.

stats

Print stats if desired.

plots

Show plots or not.

header

Data file with header?

sep

Separator for data file passed to the read.table function.

print

Send to screen unless asked to print.

new

Logical whether or not to open a new plot window before plotting

colNames

Specific names of the file to extract and work with. NULL keeps all columns

Author(s)

Ian Stewart, Allan Hicks (modifications)

See Also

mcmc.nuisance, SSgetMCMC

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
  ## Not run: 
      mcmc.df <- SSgetMCMC(dir="mcmcRun", writecsv=T,
                  keystrings = c("NatM", "R0", "steep", "Q_extraSD"),
                  nuisancestrings = c("Objective_function", "SPB_", "InitAge", "RecrDev"))
      mcmc.out("mcmcRun",run="",numparams=4,closeall=F)

  #Or for more control
      par(mar=c(5,3.5,0,0.5),oma=c(0,2.5,0.2,0))
      mcmc.out("mcmcRun",run="",numparams=1,closeall=F,new=F,colNames=c("NatM_p_1_Fem_GP_1"))
      mtext("M (natural mortality)",side=2,outer=T,line=1.5,cex=1.1)
  
## End(Not run)

r4ss documentation built on May 29, 2017, 2:24 p.m.