runSims | R Documentation |
This functions runs a TCSAM02 model multiple times initial parameter values to create simulated data to assess model consistency and estimation bias.
runSims(
os = "osx",
path = ".",
model = "tcsam02",
path2model = "",
configFile = "",
pinFile = file.path(path, "tcsam02.pin"),
numRuns = 3,
minPhase = 1,
out.csv = "simResults.csv",
calcOFL = FALSE,
cleanup = TRUE,
keepFiles = c("tmp.sh", "tcsam02.par"),
cleanupAll = FALSE
)
os |
|
path |
|
model |
|
path2model |
|
configFile |
|
pinFile |
|
numRuns |
|
minPhase |
|
out.csv |
|
calcOFL |
|
cleanup |
|
keepFiles |
|
cleanupAll |
|
For each model run, this function creates a shell script ('./tmp.sh') in the working directory and uses it to run the ADMB version of the TCSAM02 model in "fit sim" mode. Initial model parameters are taken from a preliminary model run and used as the basis for simulating data prior to fitting the model. The seed and final objective function value are saved for each model run in a csv file (the value of out.csv).
When all the models requested have been run, the function determines the seed associated with the 1st model run that yielded the smallest value for the objective function and re-runs the model using this seed to re-create the model run resulting in the minimum objectve function to recreate the model output files. The final model run is done estimating the hessian, so standard deviations for estimated model parameters are available in the .std file.
list w/ 2 elements: dfrSmry - dataframe with seed, objective function, and other summary values from all model runs parList - list of par dataframes for each model run
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.