simConf | R Documentation |
This function generates a data frame with random trials generated according to
the computational model of decision confidence specified in the model
argument
with given parameters.
Simulations can be used to visualize and test qualitative model predictions
(e.g. using previously fitted parameters returned by fitConf
).
See fitConf
for a full mathematical description of all models
and their parameters.
simConf(model = "SDT", paramDf)
model |
|
paramDf |
a
|
The function generates about N
trials per row with the provided parameters
in the data frame. The output includes a column participant
indicating the
row ID of the simulated data. The values of the participant
column may be
controlled by the user, by including a participant
column in the input
paramDf
. Note that the values of this column have to be unique! If no
participant
column is present in the input, the row numbers will be used
as row IDs.
The number of simulated trials for each row of parameters may slightly
deviate from the provided N
.
Precisely, if there are K levels of sensitivity (i.e. there are columns
d1, d2, ..., dK), the function simulates round(N/2/K)
trials per stimulus
identity (2 levels) and level of sensitivity (K levels).
Simulation is performed following the generative process structure of the models.
See fitConf
for a detailed description of the different models.
a dataframe with about nrow(paramDf)*N
rows (see Details),
and the following columns:
participant
giving the row ID of the simulation (see Details)
stimulus
giving the category of the stimulus (-1 or 1)
only, if more than 1 sensitivity parameter (d1
,d2
,...) is provided:
diffCond
representing the difficulty condition (values correspond to
the levels of the sensitivity parameters, i.e. diffCond=1 represents
simulated trials with sensitivity d1
)
response
giving the response category (-1 or 1, corresponding to the stimulus categories)
rating
giving the discrete confidence rating (integer, number of
categories depends on the number of confidence criteria provided in the parameters)
correct
giving the accuracy of the response (0 incorrect, 1 correct)
ratings
same as rating
but as a factor
Manuel Rausch, manuel.rausch@hochschule-rhein-waal.de
# 1. define some parameters
paramDf <- data.frame(d_1 = 0, d_2 = 2, d_3 = 4,c = .0,
theta_minus.2 = -2, theta_minus.1 = -1, theta_plus.1 = 1, theta_plus.2 = 2,
sigma = 1/2, w = 0.5, N = 500)
# 2. Simulate dataset
SimulatedData <- simConf(model = "WEV", paramDf)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.