This function fits multiple sets of simulated data using a loop. You need to provide a list of simulation functions, fitting functions, and parameter bounds. If you prefer to handle the process manually, you can use the internal functions `simulate_list` and `recovery_data`.
For more information, please refer to the GitHub repository: https://github.com/yuki-961004/binaryRL
rcv_d(
data,
id = NULL,
n_trials = NULL,
simulate_models = list(TD, RSTD, Utility),
simulate_lower = list(c(0, 0), c(0, 0, 0), c(0, 0, 0)),
simulate_upper = list(c(1, 1), c(1, 1, 1), c(1, 1, 1)),
fit_models = list(TD, RSTD, Utility),
fit_lower = list(c(0, 0), c(0, 0, 0), c(0, 0, 0)),
fit_upper = list(c(1, 1), c(1, 1, 1), c(1, 1, 1)),
model_names = c("TD", "RSTD", "Utility"),
funcs = NULL,
initial_params = NA,
initial_size = 50,
iteration_s = 10,
iteration_f = 10,
seed = 1,
nc = 1,
algorithm
)
A list where each element is a data.frame. Each data.frame within this list records the results of fitting synthetic data (generated by Model A) with Model B.
[data.frame] raw data. This data should include the following mandatory columns:
1. L-BFGS-B (from `stats::optim`);
2. Simulated Annealing (`GenSA`);
3. Genetic Algorithm (`GA`);
4. Differential Evolution (`DEoptim`);
5. Particle Swarm Optimization (`pso`);
6. Bayesian Optimization (`mlrMBO`);
7. Covariance Matrix Adapting Evolutionary Strategy (`cmaes`);
8. Nonlinear Optimization (`nloptr`)
[vector] Specifies which subject is being analyzed. In recovery analyses, individual subject information is not needed; trials from the same experimental procedure can be used across all "subjects". Therefore, `id` can be set to `1`. For example, `id = 1`.
[integer] number of total trials
[list] A collection of functions used to generate simulated data.
[list] The lower bounds for simulate models
[list] The upper bounds for simulate models
[list] A collection of functions applied to fit models to the data.
[list] The lower bounds for model fit models
[list] The upper bounds for model fit models
[list] the names of fit modals
[vector] A character vector containing the names of all user-defined functions required for the computation.
[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 in simulation (simulate)
[integer] the number of iteration in algorithm (fit)
[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.