SS_RunJitter {r4ss} | R Documentation |
Iteratively apply the jitter option in SS
Description
Iteratively run a Stock Synthesis model with different jittered starting parameter values based on the jitter fraction. Output files are renamed in the format Report1.sso, Report2.sso, etc.
Usage
SS_RunJitter(
mydir,
model = "ss",
extras = "-nohess",
Njitter,
Intern = TRUE,
systemcmd = FALSE,
printlikes = TRUE,
verbose = FALSE,
jitter_fraction = NULL,
init_values_src = NULL
)
Arguments
mydir |
Directory where model files are located. |
model |
Name of the Stock Synthesis model file (which has the .exe for
on Windows) in |
extras |
Additional command line arguments passed to the executable.
The default, |
Njitter |
Number of jitters, or a vector of jitter iterations.
If |
Intern |
Show command line info in R console or keep hidden. The default,
|
systemcmd |
Option to switch between 'shell' and 'system'. The default,
|
printlikes |
A logical value specifying if the likelihood values should be printed to the console. |
verbose |
A logical value specifying if output should be printed to the screen. |
jitter_fraction |
The value, typically 0.1, used to define a uniform
distribution in cumulative normal space to generate new initial parameter values.
The default of |
init_values_src |
Either zero or one, specifying if the initial values to
jitter should be read from the control file or from the par file, respectively.
The default is |
Value
A vector of likelihoods for each jitter iteration.
Author(s)
James T. Thorson, Kelli F. Johnson, Ian G. Taylor
Examples
## Not run:
#### Run jitter from par file with arbitrary, but common, choice of 0.1
modeldir <- tail(dir(system.file("extdata", package = "r4ss"), full.names = TRUE), 1)
numjitter <- 25
jit.likes <- SS_RunJitter(
mydir = modeldir, Njitter = numjitter,
jitter_fraction = 0.1, init_value_src = 1
)
#### Read in results using other r4ss functions
# (note that un-jittered model can be read using keyvec=0:numjitter)
profilemodels <- SSgetoutput(dirvec = modeldir, keyvec = 1:numjitter, getcovar = FALSE)
# summarize output
profilesummary <- SSsummarize(profilemodels)
# Likelihoods
profilesummary[["likelihoods"]][1, ]
# Parameters
profilesummary[["pars"]]
## End(Not run)