This function applies `optimize_para` to each fake data in the list generated by `simulate_list`. The results can be used for parameter recovery and model recovery, helping evaluate the consistency and validity of the reinforcement learning model.
For more information, please refer to the GitHub repository: https://github.com/yuki-961004/binaryRL
recovery_data(
list,
id = 1,
fit_model,
funcs = NULL,
model_name,
n_params,
n_trials,
lower,
upper,
initial_params = NA,
initial_size = 50,
iteration = 10,
seed = 123,
nc = 1,
algorithm
)
a data frame for parameter recovery and model recovery
[list] a list generated by function `simulate_list`
[integer] default = 1
[function] fit model
[vector] A character vector containing the names of all user-defined functions required for the computation.
[character] the name of your modal
[integer] The number of free parameters in your model.
[integer] The total number of trials in your experiment.
[vector] lower bounds of free parameters
[vector] upper bounds of free parameters
[vector] Initial values for the free parameters. These need to be set only when using L-BFGS-B. Other algorithms automatically generate initial values. for `L-BFGS-B`, `GenSA`, set `initial = c(0, 0, ...)`
[integer] Initial values for the free parameters. These need to be set only when using L-BFGS-B. Other algorithms automatically generate initial values. for `Bayesian`, `GA`, set `initial = 50`
[integer] the number of iteration
[integer] random seed. This ensures that the results are reproducible and remain the same each time the function is run. default: `seed = 123`
[integer] Number of CPU cores to use for parallel computation.
[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.