View source: R/simulate_rtmpt_SBC.R
sim_ertmpt_data_SBC | R Documentation |
Simulate data from RT-MPT models using ertmpt_model
objects. The difference to sim_ertmpt_data
is that here only scalars are allowed. This makes it usable for
simulation-based calibration (SBC; Talts et al., 2018). You can specify the random seed, number of subjects, number of trials, and some
parameters (same as prior_params
from fit_ertmpt
).
sim_ertmpt_data_SBC(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 ertmpt_sim
containing
data
: the data.frame with the simulated data,
gen_list
: a list containing lists of the group-level and subject-specific parameters for the process-related parameters and the motor-related
parameters, and the trial-specific probabilities, process-times, and motor-times,
specs
: some specifications like the model, seed number, etc.,
Raphael Hartmann
Talts, S., Betancourt, M., Simpson, D., Vehtari, A., & Gelman, A. (2018). Validating Bayesian inference algorithms with simulation-based calibration. arXiv preprint arXiv:1804.06788.
########################################################################################
# Detect-Guess variant of the Two-High Threshold model.
# The encoding and motor execution times are assumed to be different for each response.
########################################################################################
mdl_2HTM <- "
# targets
do+(1-do)*g ; 0
(1-do)*(1-g) ; 1
# lures
(1-dn)*g ; 0
dn+(1-dn)*(1-g) ; 1
# do: detect old; dn: detect new; g: guess
"
model <- to_ertmpt_model(mdl_file = mdl_2HTM)
params <- list(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 <- rtmpt:::sim_ertmpt_data_SBC(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.