Description Usage Arguments Value Author(s) Examples
View source: R/simulate_rtmpt.R
Simulate data from RTMPT models using rtmpt_model
objects.
You can specify the random seed, number of subjects, number of trials per tree, and some
parameters (mainly the same as prior_params
from fit_rtmpt
).
1  sim_rtmpt_data(model, seed, n.subj, n.trials, params = NULL)

model 
A list of the class 
seed 
Random seed number. 
n.subj 
Number of subjects. 
n.trials 
Number of trials per tree. 
params 
Named list of parameters from which the data will be generated. This must be the same named list as

A list of the class rtmpt_sim
containing
data
: the data.frame with the simulated data,
gen_list
: a list containing lists of the grouplevel and subjectspecific parameters for the processrelated parameters and the motorrelated
parameters, and the trialspecific probabilities, processtimes, and motortimes,
specs
: some specifications like the model, seed number, etc.,
Raphael Hartmann
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50  ########################################################################################
# DetectGuess variant of the TwoHigh Threshold model.
# The encoding and motor execution times are assumed to be different for each response.
########################################################################################
mdl_2HTM < "
# targets
do+(1do)*g ; 0
(1do)*(1g) ; 1
# lures
(1dn)*g ; 0
dn+(1dn)*(1g) ; 1
# do: detect old; dn: detect new; g: guess
"
model < to_rtmpt_model(mdl_file = mdl_2HTM)
# random grouplevel parameters
params < list(mean_of_mu_alpha = 0,
#var_of_mu_alpha = 1
mean_of_exp_mu_beta = 10,
var_of_exp_mu_beta = 10,
mean_of_mu_gamma = 0.5,
var_of_mu_gamma = 0.0025,
mean_of_omega_sqr = 0.005,
var_of_omega_sqr = 0.000025,
df_of_sigma_sqr = 10,
sf_of_scale_matrix_SIGMA = 0.1,
sf_of_scale_matrix_GAMMA = 0.01,
prec_epsilon = 10,
add_df_to_invWish = 5)
sim_dat < sim_rtmpt_data(model, seed = 123, n.subj = 40, n.trials = 30, params = params)
# fixed grouplevel parameters
params < list(mean_of_mu_alpha = 0,
mean_of_exp_mu_beta = 10,
mean_of_mu_gamma = 0.5,
mean_of_omega_sqr = 0.005,
df_of_sigma_sqr = 10,
sf_of_scale_matrix_SIGMA = 0.1,
sf_of_scale_matrix_GAMMA = 0.01,
prec_epsilon = 10,
add_df_to_invWish = 5,
SIGMA = diag(9), # independent processrelated params
GAMMA = diag(2)) # independent motor time params
sim_dat < sim_rtmpt_data(model, seed = 123, n.subj = 40, n.trials = 30, params = params)

Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.