simdiff {diffIRT}R Documentation

Simulate data according to the D-diffusion or Q-diffusion IRT model.

Description

This function simulates responses and response time data according to the D-diffusion or Q-diffusion IRT model.

Usage

simdiff(N,nit,ai=NULL,vi=NULL,gamma=NULL,theta=NULL,ter=NULL,
        model="D",max.iter=19999,eps=1e-15)

Arguments

N

number of subjects.

nit

number of items.

ai

a vector of length nit containing the true values for the item boundary separation, a[i].

vi

a vector of length nit containing the true values for the item drift rate, v[i].

gamma

a vector of length N containing the true values for the person boundary separation, gamma[p].

theta

a vector of length N containing the true values for the person drift rate, theta[p].

ter

a vector of length nit containing the true values for the item non-decision time, ter[i].

model

string; Either "D" to fit the D-diffusion IRT model or "Q" to fit the Q-diffusion IRT model.

max.iter

maximum number of iterations for the rejection algorithm. See Details.

eps

convergence criterion for the rejection algorithm. See Details

Details

Function simdiff is an extension of the rejection algorithm outlined in Tuerlinckx et al. (2001). In this algorithm, a proposal response time is sampled from an exponential distribution. This proposal is accepted as actual response time when a specific condition is satisfied (see Eq. 16 in Tuerlinckx, 2001). As this condition requires the approximation of an infinite sum, a convergence criterion needs to be specified (see the argument eps). When the condition is not satisfied, a new proposal response time is sampled. This is repeated until the proposal response time is accepted or when max.iter has been reached.

Value

Returns a list with the following entries:

rt

the simulated matrix of response times

x

the simulated matrix of responses

ai

true values for ai[i]

vi

true values for vi[i]

gamma

true values for gamma[p]

theta

true values for theta[p]

ter

true values for ter[i]

Author(s)

Dylan Molenaar d.molenaar@uva.nl

References

Tuerlinckx, F., Maris, E., Ratcliff, R., & De Boeck, P. (2001). A comparison of four methods for simulating the diffusion process. Behavior Research Methods, Instruments & Computers, 33, 443-456.

See Also

diffIRT for fitting diffusion IRT models.

Examples

## Not run: 
# simulate data accroding to D-diffusion model
data=simdiff(N=100,nit=10,model="D")                   


## End(Not run)  

[Package diffIRT version 1.5 Index]