g3_leaveout: Leave-one-out analysis.

View source: R/g3_leaveout.R

g3_leaveoutR Documentation

Leave-one-out analysis.

Description

Perform a leave-one-out analysis. This involves running a set of optimisations, each one of which has a component (or set of components) turned off (i.e. weight = 0).

Usage

g3_leaveout(
  gd,
  outdir = "LOCV",
  model,
  params,
  grouping = list(),
  use_parscale = TRUE,
  method = "BFGS",
  control = list(),
  serial_compile = FALSE,
  mc.cores = parallel::detectCores()
)

Arguments

gd

Directory to store output

outdir

Directory name within gd to store run outputs

model

A G3 model, produced by g3_to_tmb() or g3_to_r()

params

Initial parameters to use with the model, this should be a TMB parameter template i.e. attr(tmb_model, 'parameter_template')

grouping

List of component names to group together. This allows you to leave out multiple components at a time, e.g. length and age-length distributions from a particular fleet

use_parscale

Logical indicating whether optim(control$parscale) should be used

method

The optimisation method, see optim

control

List of control options for optim, see optim

serial_compile

g3_tmb_adfun will be run in serial mode (i.e., not in parallel), potentially helping with memory issues

mc.cores

The number of cores to use, defaults to the number available

Details

g3_leaveout performs a leave-one-out analysis.

Value

A list of optimised parameter data frames (one for each group)


gadget-framework/gadgetutils documentation built on Aug. 16, 2024, 8:45 a.m.