g3_sensitivity: Sensitivity analysis

View source: R/g3_sensitivity.R

g3_sensitivityR Documentation

Sensitivity analysis

Description

g3_sensitivity performs a sensitivity analysis for a single parameter.

Usage

g3_sensitivity(
  gd,
  outdir = "SENS",
  model,
  params,
  par_name,
  par_values,
  use_parscale = TRUE,
  method = "BFGS",
  control = list(),
  serial_compile = FALSE,
  return_input_parameters = FALSE,
  run_optimisations = TRUE,
  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')

par_name

A glob-like string to match parameter names, see the 'name_spec' argument for g3_init_val

par_values

A vector of values to substitute into params

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

return_input_parameters

If TRUE, returns a list of modified parameter dataframes (i.e. without optimisations)

run_optimisations

If TRUE, will return a list of fits using the modified (non-optimised) parameters

mc.cores

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

Value

A list of parameter dataframes (either optimised or not) or a list of fits based on the unoptimised parameters


gadget-framework/gadgetutils documentation built on June 13, 2025, 3:05 a.m.