build_param_matrix: Build the matrix storing parameters

Description Usage Arguments Details Value Examples

View source: R/parameters.R

Description

This function is called internally by other functions. It initializes the matrix storing parameter values. This function is used to set the initial parameter values before optimisation and to update the parameter values during optimisation. The matrix created by the function contains as many rows as the number of parameters and one column storing the parameter values. The parameter names are stored as row names. The matrix also contains the completed attribute param_str, used internally.

Usage

1
build_param_matrix(param_values = 0, param_str = NULL)

Arguments

param_values

The vector of values for the parameters

param_str

The named vector indicating the parameter structure, that is, the type of subcategory for each meta parameter

Details

For a given meta parameter, we only implemented the different types which we consider relevant for our purpose: the meta parameters "w1", "b2", "w2", "b2" can take the types "0", "1", or "s" (value fixed at zero, a unique parameter value, and one parameter value per sex); "w3" can either be "0+t+l", "1+t+l", or "s+t+l" (one parameter fixed at 0, or a unique parameter, or one per sex, followed by one parameter value per birth cohort and location); "w4", "w5", "b4" and "b5 can take "0", "1", "s", "c" (value fixed at zero, a unique value, one per sex, one per capture method). (The syntax "s:c" is also used for creating sex capture-method combination but should be only used internally.)

Value

A matrix.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
build_param_matrix()
build_param_matrix(param_values = 0.1)
build_param_matrix(param_values = 0.1, param_str = c("b1" = "s", "w3" = "1+t+l", w4 = "c"))
build_param_matrix(param_values = c(0.1, 0.2, 0.4, 0.3),
                   param_str = c("b1" = "s", "b2" = "s"))
build_param_matrix(param_values = 0.1,
                   param_str = c("w1" = "1",
                                 "b1" = "s",
                                 "w2" = "1",
                                 "b2" = "1",
                                 "w3" = "1+t+l",
                                 "w4" = "1",
                                 "w5" = "1",
                                 "b4" = "1",
                                 "b5" = "1"))

courtiol/SileR documentation built on May 16, 2020, 8:10 p.m.