Learn R Programming

binaryRL (version 0.8.9)

simulate_list: Process: Simulating Fake Data

Description

This function generates simulated data using a user-defined objective function. You can specify the number of iterations to control how many data are generated. These datasets can be used for parameter recovery and model recovery. For more information, please refer to the GitHub repository: https://github.com/yuki-961004/binaryRL

Usage

simulate_list(
  data,
  id = 1,
  obj_func,
  n_params,
  n_trials,
  lower,
  upper,
  iteration = 10,
  seed = 123
)

Value

a list with fake data generated by random free parameters

Arguments

data

[data.frame] raw data. This data should include the following mandatory columns: - "sub", "time_line", "L_choice", "R_choice", "L_reward", "R_reward".

id

[vector] which subject is going to be analyzed. is being analyzed. The value should correspond to an entry in the "sub" column, which must contain the subject IDs. e.g., `id = c(1:40)`

obj_func

[function] a function with only ONE argument `params`. Additionally, it is important to note that the data needs to be retrieved from parent.frame(). This function returns the binaryRL.res(res).

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

iteration

[integer] the number of iteration

seed

[integer] random seed. This ensures that the results are reproducible and remain the same each time the function is run. default: `seed = 123`