One row per subject and trial, with the payoff schedule of EVERY option fixed in advance and a placeholder response. Fixing the whole schedule ahead of the choices is what makes a draw from these models coherent: a simulated subject that takes the arm the real one did not still needs to be paid.
Arguments
- task
One of
"bandit2arm"(a stationary two-armed bandit),"reversal"(the same with the contingency reversed at the halfway point, and anafter_reversalfactor to model it with),"bandit4arm_restless"(four arms whose payoffs follow the decaying Gaussian random walk of Daw et al. 2006),"igt"(the Iowa gambling task's four decks) or"twostep"(the two-stage Markov task of Daw et al. 2011).- n_subject, n_trial
Subjects, and trials per subject.
- p
Two payoff probabilities, for the two-armed tasks.
- seed
Passed to
set.seed()when notNULL.- ...
Task-specific settings:
decayandcenterandsd_walkandsd_obsfor the restless bandit,p_rewardfor the two-step task's stage-two options.
Value
A data frame, ready for frm_task_simulate().
Details
The column names are canonical, because frm_task_simulate() reads
them: id, trial, choice, and pay1 to pay2 or pay4. A fit
to your own data needs none of this; the family reads whatever
columns your formula names.
Examples
d <- frm_task_design("reversal", n_subject = 4, n_trial = 20, seed = 1)
head(d)
#> id trial choice after_reversal pay1 pay2
#> 1 1 1 1 before 1 0
#> 2 1 2 1 before 1 1
#> 3 1 3 1 before 1 0
#> 4 1 4 1 before 0 0
#> 5 1 5 1 before 1 1
#> 6 1 6 1 before 0 0
table(d$after_reversal)
#>
#> before after
#> 40 40