simulateSSP: Obtain simulated response times and accuracy from the SSP...

View source: R/sspFunctions.R

simulateSSPR Documentation

Obtain simulated response times and accuracy from the SSP model

Description

simulateSSP generates synthetic data from the DSTP model in the form of response time (RT) in seconds and accuracy for both congruent and incongruent trials.

Usage

simulateSSP(parms, nTrials, var = 0.01, dt = 1/1000, seed = NULL)

Arguments

parms

The set of parameters to use to simulate the data. Must be contained in a vector in the order: A, ter, p, rd, sda.

nTrials

How many trials to simulate per congruency condition.

var

The variance of the diffusion process. By default this is set to 0.01.

dt

The diffusion scaling parameter (i.e., time steps). By default, this is set to 0.001.

seed

The value for the set.seed function to set random generation state.

Details

This function can be employed by the user to generate synthetic data, but its main purpose is to be used by the fitting procedure to generate model predictions for a set of parameter values when trying to find the best- fitting values.

Value

Returns a data frame with three columns: rt (response time) in seconds, accuracy of the model's response (1 for correct, 0 for error), and congruency condition.

Examples

# declare the parameters
parms <- c(0.050, 0.300, 0.400, 0.040, 1.500)

# simulate the data
modelData <- simulateSSP(parms, nTrials = 10000)


JimGrange/flankr documentation built on Dec. 10, 2023, 12:17 a.m.