callGadget.Rd
This function sets up all necessary switches and calls gadget from R and attempts to read the runtime output from gadget. This has currently only been tested on unix based platforms (but should in principle work on windows, given that gadget can be compiled). The source code for gadget can be obtained from https://github.com/hafro/gadget
callGadget(
l = NULL,
s = NULL,
n = NULL,
v = NULL,
h = NULL,
i = NULL,
opt = NULL,
main = NULL,
m = NULL,
p = NULL,
o = NULL,
print = NULL,
precision = NULL,
log = NULL,
printinitial = NULL,
printfinal = NULL,
gadget.exe = "gadget",
ignore.stderr = FALSE,
parallel = NULL
)
performs a likelihood (optimising) model run
perform a single (simulation) model run
perform a network run (using paramin)
display version information and exit
display this help screen and exit
name of the file containing the model parameters
name of the file containing the optimising parameters
name of the main file (optional, as default it will look for 'main'
name of the file containing additional parameters (optional)
name of the file to which the parameter estimates should be output to. Default is 'params.out'
name of the file to which the likelihood-output should be saved (optional).
Number. print -o output every <number> iterations.
set the precision to <number> in output files
Name of the file to which the logging information should be saved.
Name of the file to which the initial model information should be saved.
Name of the file to which the final model information should be saved.
path to the gadget executable, if not set, first looks to see if the gadget R package is installed, if that fails uses the system path. .Options$gadget.path will override any given parameter.
should error output be ignored
(experimental) should the parallel option be used
the run history
Gadget is a flexible and powerful tool for creating ecosystem models. The program was developed for modelling marine ecosystems in a fisheries management and biology context, however there is nothing in the program that restricts it to fish , and models have been developed to examine marine mammal populations. Indeed there is nothing to demand that the populations being considered are marine, or even aquatic, in nature. Gadget allows you to include a number of features into your model: One or more species, each of which may be split into multiple stocks; multiple areas with migration between areas; predation between and within species; maturation; reproduction and recruitment; multiple commercial and survey fleets taking catches from the populations. Gadget does two separate, but related things. Firstly it takes a model specification and performs a simulation using that set up. The model specification dictates the form of the equations to be used to describe growth, recruitment, fleet selectivity and so on, and the exact parameters to be used in these equations. Gadget will calculate model population and catches through time for your given set up. Note that to do this it does not use real-world data (except possibly overall catch tonnage). The program then compares various aspects of the modelled catches with real-world data from actual catches, and produces numeric likelihood scores measuring how well the model matched each data set. The program also computes a single overall likelihood score. This is a single number representing the 'goodness of fit' between the simulation and the data. It is worth repeating this point. Gadget runs a complete simulation without reference to any data. It then compares the modelled and real catches, and produces a score evaluating the fit between the two. If Gadget is called upon to optimise a model solution it simply iterates this process, trying different parameter values for each iteration. The 'best fit' will be produced by the parameter set which produces a model with the lowest overall likelihood score. There are several different optimisation methods utilised.