All functions

callGadget()

Call GADGET

callParamin()

Call paramin

gadget.forward() gadget.ypr()

Deprecated functions

fix_headers()

Fix data headers in Gadget input files

gadget.fit() bind.gadget.fit()

Gadget fit

gadget.iterative() gadget.iterative()

Removed functions

read.gadget.parameters() write.gadget.parameters() init_guess() wide_parameters()

Gadget parameters

gadget.phasing()

Gadget Phasing

gadget.retro()

Analytical retrospective

gadget.retro.fit()

Retro fit

gadget.variant.dir()

Write the changes to the model into a model variant directory

read.gadget.likelihood() write.gadget.likelihood() get.gadget.likelihood() read.gadget.main() write.gadget.main() clear.spaces() read.gadget.data() strip.comments() read.gadget.wgts() read.gadget.grouping()

Old style gadget file input and output (mostly deprecated)

gadget_catchdistribution_component()

http://hafro.github.io/gadget/docs/userguide/chap-like.html#sec:catchdist

gadget_catchinkilos_component()

http://hafro.github.io/gadget/docs/userguide/chap-like.html#sec:catchinkilos

gadget_catchstatistics_component()

http://hafro.github.io/gadget/docs/userguide/chap-like.html#sec:catchstat

gadget_discard()

Discard named component

gadget_discard(<gadgetfleet>)

this function removes named fleet components

gadget_discard(<gadgetlikelihood>)

this function removes named likelihood components

gadget_discard(<gadgetprint>)

this function removes named print components

gadget_evaluate()

Evaluate a gadget model

gadget_filetypes

Recognised GADGET file types and their quirks

gadget_fit()

Gadget fit

gadget_iterative_stage_1() gadget_iterative_stage_2()

Iterative reweighting for Gadget models An implementation of the iterative reweigthing of likelihood components in gadget. It analyzes a given gadget model and, after a series of optimisations where each likelihood component is heavily weigthed, suggests a weigthing for the components based on the respective variance. If one (or more) components, other than understocking and penalty, are 0 then the gadget optimisation with the final weights will not be completed. In Taylor et. al an objective reweighting scheme for likelihood components is described for cod in Icelandic waters. The authors nota that the issue of component weighting has been discussed for some time, as the data sources have different natural scales (e.g g vs. kg) that should not affect the outcome. A simple heuristic, where the weights are the inverse of the initial sums of squares for the respective component resulting in an initials score equal to the number of components, is therfor often used. This has the intutitive advantage of all components being normalised. There is however a drawback to this since the component scores, given the initial parametrisation, are most likely not equally far from their respective optima resulting in sub-optimal weighting. The iterative reweighting heuristic tackles this problem by optimising each component separately in order to determine the lowest possible value for each component. This is then used to determine the final weights. The resoning for this approach is as follows: Conceptually the likelihood components can be thought of as residual sums of squares, and as such their variance can be esimated by dividing the SS by the degrees of freedom. The optimal weighting strategy is the inverse of the variance. Here the iteration starts with assigning the inverse SS as the initial weight, that is the initial score of each component when multiplied with the weight is 1. Then an optimisation run for each component with the intial score for that component set to 10000. After the optimisation run the inverse of the resulting SS is multiplied by the effective number of datapoints and used as the final weight for that particular component. The effective number of datapoints is used as a proxy for the degrees of freedom is determined from the number of non-zero datapoints. This is viewed as satisfactory proxy when the dataset is large, but for smaller datasets this could be a gross overestimate. In particular, if the surveyindices are weigthed on their own while the yearly recruitment is esimated they could be overfitted. If there are two surveys within the year Taylor et. al suggest that the corresponding indices from each survey are weigthed simultaneously in order to make sure that there are at least two measurement for each yearly recruit, this is done through component grouping which is implemented. Another approach, which is also implemented, for say a single survey fleet the weight for each index component is estimated from a model of the form $$\log(I_{lts}) = \mu + Y_t + \lambda_l + \Sigma_s + \epsilon_{lts}$$ where the residual term, \(\epsilon_{lts}\), is independent normal with variance \(\sigma_{ls}^2\). The inverse of the estimated variance from the above model as the weights between the surveyindices. After these weights have been determined all surveyindices are weighted simultaneously.

gadget_likelihoodprinter_component()

https://hafro.github.io/gadget2/userguide/chap-print.html#sec:likelihoodprinter

gadget_likelihoodsummaryprinter_component()

https://hafro.github.io/gadget2/userguide/chap-print.html#sec:likelihoodsummaryprinter

gadget_migrationpenalty_component()

http://hafro.github.io/gadget/docs/userguide/chap-like.html#sec:migpenalty

gadget_optimize()

Evaluate a gadget model

gadget_penalty_component()

http://hafro.github.io/gadget/docs/userguide/chap-like.html#sec:boundlike

gadget_predatoroverprinter_component()

https://hafro.github.io/gadget2/userguide/chap-print.html#sec:predatoroverprinter

gadget_predatorpreyprinter_component()

https://hafro.github.io/gadget2/userguide/chap-print.html#sec:predatorpreyprinter

gadget_predatorprinter_component()

https://hafro.github.io/gadget2/userguide/chap-print.html#sec:predatorprinter

gadget_project_time() gadget_project_stocks() gadget_project_fleet() gadget_project_prognosis_likelihood() gadget_project_recruitment() gadget_project_advice() gadget_project_ref_points() gadget_project_output()

Gadget projection function

gadget_recaptures_component()

http://hafro.github.io/gadget/docs/userguide/chap-like.html#sec:recaptures

gadget_recstatistics_component()

http://hafro.github.io/gadget/docs/userguide/chap-like.html#sec:recstat

gadget_stockdistribution_component()

http://hafro.github.io/gadget/docs/userguide/chap-like.html#sec:stockdist

gadget_stockfullprinter_component()

https://hafro.github.io/gadget2/userguide/chap-print.html#sec:stockfullprinter

gadget_stockpreyfullprinter_component()

https://hafro.github.io/gadget2/userguide/chap-print.html#sec:stockpreyfullprinter

gadget_stockpreyprinter_component()

https://hafro.github.io/gadget2/userguide/chap-print.html#sec:stockpreyprinter

gadget_stockprinter_component()

https://hafro.github.io/gadget2/userguide/chap-print.html#sec:stockprinter

gadget_stockstdprinter_component()

https://hafro.github.io/gadget2/userguide/chap-print.html#sec:stockstdprinter

gadget_stomachcontent_component()

http://hafro.github.io/gadget/docs/userguide/chap-like.html#sec:stomach

gadget_surveydistribution_component()

http://hafro.github.io/gadget/docs/userguide/chap-like.html#sec:surveydistribution

gadget_surveyindices_component()

http://hafro.github.io/gadget/docs/userguide/chap-like.html#sec:surveyindices

gadget_understocking_component()

http://hafro.github.io/gadget/docs/userguide/chap-like.html#sec:understocking

gadget_update()

Update gadget components

gadget_update(<gadgetfleet>)

Update gadget fleet components in a fleet file

gadget_update(<gadgetlikelihood>)

Update gadget likelihood components in a likelihood file

gadget_update(<gadgetprint>)

Update gadget print components in a print file

gadget_update(<gadgetstock>)

Update comonents of a gadgetstock object

gadget_update(<gadgettime>)

Update gadget time components in a time file

gadgetdata()

Construct a data-only gadget file

gadgetfile()

Construct a new gadgetfile S3 object

gadgetfleet()

Create a gadgetfleet object

gadgetfleetcomponent()

Create/update a fleet component with name

gadgetlikelihood()

Create a gadgetlikelihood object

gadgetlikelihoodcomponent()

Wrapper to choose a component by name

gadgetprintcomponent()

Wrapper to choose a component by name

gadgetprintfile()

Create a gadgetprint object

gadgetstock()

Create a gadgetstock object

gadgettime()

Create a gadgettime object

gd_to_unix()

gadget.variant.dir to unix line endings

make.gadget.printfile()

Make gadget printfile

parse.gadget.formulae()

Parse a GADGET formulae string

plot(<gadget.fit>)

plot gadget fit

print(<gadgetfile>)

Print given gadgetfile to stdout

read.gadget.file()

Read gadget input file, return gadgetfile S3 class representing file

read.gadget.lik.out()

Read gadget lik.out

read.gadget.results()

Gadget results

read.printfiles()

Read gadget printfiles

sub.gadget.formulae()

Replace variables in formulae

suitability()

Prey suitability

to.gadget.formulae()

Turn R expression into GADGET formulae string

variant_append_settings()

Append setting to variant directories

von_b_formula()

von B formula

write.gadget.file()

Write gadgetfile to disk, including any dependant files, and update the mainfile