change_e {ss3sim} | R Documentation |
Methods to alter which parameters are estimated in a SS3 .ctl
file.
Description
Takes SS3 .ctl
and forecast.ss
files, along with
a list structure which houses the data file as read in by
SS_readdat
and changes which parameters are estimated, how natural mortality is
estimated, and if forecasts are performed. The function can be called by
itself or within run_ss3sim
to alter an estimation model
.ctl
file.
If used with run_ss3sim
the case file should be named
E
. A suggested (default) case letter is E
for estimation.
Usage
change_e(ctl_file_in = "em.ctl", ctl_file_out = "em.ctl",
dat_list = NULL, for_file_in = "forecasts.ss", par_name = NULL,
par_int = "NA", par_phase = "NA", forecast_num = 0,
verbose = FALSE, natM_type = NULL, natM_n_breakpoints = NULL,
natM_lorenzen = NULL, natM_val = NULL)
Arguments
ctl_file_in |
A string providing the path to the input SS |
ctl_file_out |
A string providing the path to the output SS control file. If the value is |
dat_list |
An SS data list object as read in from
|
for_file_in |
A string providing the path to the input SS
|
par_name |
*A vector of values, separated by commas. Each value
corresponds to a parameter that you wish to turn on or off in the
|
par_int |
*A vector of initial values, one for each parameter in
|
par_phase |
*A vector of phase values, one for each parameter in
|
forecast_num |
*Number of years to perform forecasts. For those years,
the data will be removed from the |
verbose |
When |
natM_type |
Deprecated. Should have value NULL. |
natM_n_breakpoints |
Deprecated. Should have value NULL. |
natM_lorenzen |
Deprecated. Should have value NULL. |
natM_val |
Deprecated. Should have value NULL. |
Details
Turning parameters on and off is the main function of
change_e
. change_e
was not created with the capability of
adding parameters to a .ctl
file. The function can only add
parameters for age specific natural mortality, and only for models with
one growth morph. Furthermore, the function is designed to add complexity
to the natural mortality type and not remove complexity. Therefore, the
function will fail if natural mortality in the ctl_file_in
is not
specified as "1Param"
and natM_type
is anything other than
NULL
or "1Param"
.
Value
Altered versions of SS3 .ctl
and forecast.ss
files are written
to the disk and the altered dat_list
is returned invisibly.
Which arguments to specifiy in case files
All function argument descriptions that start with an asterisk (*) will be passed
through the case files to run_ss3sim
. If one of these arguments
is not specified in a case file, then a value of NULL
will be passed,
which may or may not be an appropriate value. Other arguments will be ignored
if specified.
Author(s)
Kelli Johnson
See Also
Other change functions: change_data
,
change_em_binning
,
change_f_par
, change_f
,
change_o
, change_retro
,
change_tv
Examples
## Not run:
d <- system.file("extdata", "models", "cod-om", package = "ss3sim")
data.old <- r4ss::SS_readdat(
system.file("extdata", "models", "cod-om", "codOM.dat",
package = "ss3sim"),
version = NULL, verbose = FALSE)
change_e(
ctl_file_in = file.path(d, "codOM.ctl"),
ctl_file_out = file.path(tempdir(), "change_e.ctl"),
dat_list = data.old,
for_file_in = file.path(d, "forecast.ss"),
natM_type = NULL, natM_n_breakpoints = NULL,
natM_lorenzen = NULL, natM_val = NULL,
par_name = c("_steep", "SizeSel_P1_Fishery(1)"),
par_int = c(0.3, 40), par_phase = c(3, 2),
forecast_num = 0)
# clean up the temporary files
file.remove(file.path(tempdir(), "change_e.ctl"))
## End(Not run)