get_params_default: Extract default values from parameter information

View source: R/param_info_functions.R

get_params_defaultR Documentation

Extract default values from parameter information

Description

Extract default values from parameter information

Usage

get_params_default(param_info)

Arguments

param_info

Information on the parameters to estimate. Either a list containing:

  • ub and lb, named vectors of upper and lower bounds (-Inf and Inf can be used if init_values is provided),

  • default, named vectors of default values (optional, corresponding parameters are set to these values when the parameter is part of the candidate_param list and when it is not estimated ; these values are also used as first initial values when the parameters are estimated)

  • init_values, a data.frame containing initial values to test for the parameters (optional, if not provided, or if less values than number of repetitions of the minimization are provided, the, or part of the, initial values will be randomly generated using LHS sampling within parameter bounds).

or a named list containing for each parameter:

  • sit_list, list the groups of situations for which the current estimated parameter must take different values (see here for an example),

  • ub and lb, vectors of upper and lower bounds (one value per group),

  • init_values, the list of initial values per group (data.frame, one column per group, optional).

  • default, vector of default values per group (optional, the parameter is set to its default value when it is part of the candidate_param list and when it is not estimated ; the default value is also used as first initial value when the parameter is estimated)

Value

A named vector of default values

Examples


# A simple case
param_info <- list(
  lb = c(dlaimax = 0.0005, durvieF = 50),
  ub = c(dlaimax = 0.0025, durvieF = 400),
  default = c(dlaimax = 0.001, durvieF = 200)
)
CroptimizR:::get_params_default(param_info)

# A case with groups of situations per parameter
param_info <- list()
param_info$dlaimax <- list(
  sit_list = list(c(
    "bou99t3", "bou00t3", "bou99t1", "bou00t1",
    "bo96iN+", "lu96iN+", "lu96iN6", "lu97iN+"
  )),
  lb = 0.0005, ub = 0.0025, default = 0.001
)
param_info$durvieF <- list(
  sit_list = list(
    c("bo96iN+", "lu96iN+", "lu96iN6", "lu97iN+"),
    c("bou99t3", "bou00t3", "bou99t1", "bou00t1")
  ),
  lb = c(50, 100), ub = c(400, 500), default = c(200, 300)
)
CroptimizR:::get_params_default(param_info)



SticsRPacks/CroptimizR documentation built on June 11, 2025, 12:33 a.m.