simulate_QL | R Documentation |
simulate_QL
is a function to simulate data from 1-alpha and 2-alpha
Q-learning models, with an experiment structure identical to that run online.
The parameter values can be from (a sample of) those fitted previously to the
real data, or can be randomly sampled.
simulate_QL(
summary_df = NULL,
sample_size = NULL,
gain_loss = TRUE,
test = FALSE,
affect = FALSE,
time_pars = "overall",
prev_sample = NULL,
raw_df = NULL,
...
)
summary_df |
|
sample_size |
How may sets of parameters to sample; defaults to 100 or
the number of individuals in
the |
gain_loss |
Fit the dual learning rate model? |
test |
Simulate test choices in addition to training choices? |
affect |
Simulate subjective affect ratings (uses full passage-of-time model). |
time_pars |
Which time parameters to include in the affect model: either
|
prev_sample |
An optional previous sample of id numbers (if you wish to simulate data for the same subset of individual parameters across a number of models). |
raw_df |
Provide the raw data used to fit the data originally, so that subject IDs can be labelled appropriately. |
... |
Other arguments which can be used to control the parameters of the Beta/Gaussian distributions from which parameter values are sampled. |
Simulated training data (and test data relevant) for a random or previously fitted sample of parameter values.
train_sim_2a <- simulate_QL(
sample_size = 5,
alpha_pos_dens = c(shape = 2, scale = 0.1), # default
alpha_neg_dens = c(shape = 2, scale = 0.1), # default
beta_dens = c(mean = 3, sd = 1) # default
)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.