- data
[data.frame]
This data should include the following mandatory columns:
- id
[character]
Specifies the ID of the subject whose optimal parameters will be fitted.
This parameter accepts either string or numeric values. The provided
ID must correspond to an existing subject identifier within the raw
dataset provided to the function.
- obj_func
[function]
The objective function that the optimization algorithm package accepts.
This function must strictly take only one argument, `params` (a vector
of model parameters). Its output must be a single numeric value
representing the loss function to be minimized. For more detailed
requirements and examples, please refer to the relevant documentation
(
TD
,
RSTD
,
Utility
).
- n_params
[integer]
The number of free parameters in your model.
- n_trials
[integer]
The total number of trials in your experiment.
- lower
[vector]
Lower bounds of free parameters
- upper
[vector]
Upper bounds of free parameters
- initial_params
[vector]
Initial values for the free parameters that the optimization algorithm will
search from. These are primarily relevant when using algorithms that require
an explicit starting point, such as L-BFGS-B
. If not specified,
the function will automatically generate initial values close to zero.
default: initial_params = NA
.
- initial_size
[integer]
This parameter corresponds to the population size in genetic
algorithms (GA
). It specifies the number of initial candidate
solutions that the algorithm starts with for its evolutionary search.
This parameter is only required for optimization algorithms that operate on
a population, such as `GA` or `DEoptim`.
default: initial_size = 50
.
- iteration
[integer]
The number of iterations the optimization algorithm will perform
when searching for the best-fitting parameters during the fitting
phase. A higher number of iterations may increase the likelihood of
finding a global optimum but also increases computation time.
- seed
[integer]
Random seed. This ensures that the results are
reproducible and remain the same each time the function is run.
default: seed = 123
- algorithm
[character]
Choose an algorithm package from
`L-BFGS-B`, `GenSA`, `GA`, `DEoptim`, `PSO`, `Bayesian`, `CMA-ES`.
In addition, any algorithm from the `nloptr` package is also
supported. If your chosen `nloptr` algorithm requires a local search,
you need to input a character vector. The first element represents
the algorithm used for global search, and the second element represents
the algorithm used for local search.