runTCSAM02: Function to run TCSAM02.

Description Usage Arguments Details Value

View source: R/runTCSAM02.R

Description

This function runs a TCSAM02 model once.

Usage

1
2
3
4
5
runTCSAM02(os = "osx", path = ".", model = "tcsam02",
  path2model = "", configFile = "", pin = FALSE, minPhase = 1,
  maxPhase = NULL, calcOFL = FALSE, hess = FALSE, mcmc = FALSE,
  mc.N = 1e+06, mc.save = 1000, mc.scale = 1000, jitter = FALSE,
  jit.seed = NULL, saveResults = hess, cleanup = TRUE)

Arguments

os

- 'win', 'mac', 'osx', or 'linux'

path

- path for model output

model

- TCSAM02 model executable name

path2model

- path to model executable

configFile

- filename (including path) to model configuration file

pin

- T/F to use a pin file

minPhase

- phase to start minimization (or NULL)

maxPhase

- final minimization phase (or NULL)

calcOFL

- flag (T/F) to perform OFL calculations

hess

- T/F to compute hessian (and .std file)

mcmc

- T/F to run mcmc

mc.N

- number of mcmc iterations to do

mc.save

- number of iterations to skip when saving mcmc calculations

mc.scale

- number of iterations to adjust scale for mcmc calculations

jitter

- T/F to jitter parameters

jit.seed

- seed for random number generator (or NULL)

saveResults

- T/F to save results to ModelResults.RData as a tcsam02.resLst object using getResLst(...)

cleanup

- flag (T/F) to clean up some output files

Details

This function creates a shell script ('./tmp.sh') in the working directory and uses it to run a version of the TCSAM02 model.
Initial model parameters can be jittered based on the system clock time as a jit.seed to the random number generator. The jit.seed and final objective function value are saved for each model run in a csv file (the value of out.csv).

If the path associated with configFile is a relative one, it should be relative to the path variable. If saveResults=TRUE, getResLSt() is used to read in the report file, prs file, and std files are read in and the resulting tcsam02.resLst object is saved to 'ModelResults.RData'. If jitter=TRUE, hess=FALSE, and cleanup=TRUE, then most output files (including the .rep files) are deleted after the model run to save disk space.

Value

- dataframe of class 'tcam02.par', with 2 columns (name, value) with jitter jit.seed (if jittered) and par file info, or NULL if par file does not exist.


wStockhausen/rTCSAM02 documentation built on Nov. 10, 2018, 7:42 p.m.