distance {qmvs}R Documentation

Calculation of the Wasserstein metric between an empirical data set and a data set similated by the queueing model of visual search

Description

WM calculates a distance between the empirical and simulated response time on a given number of trials in an experiment using standard visual search paradigm. WMdiffresp takes both correct and incorrect response times into account. WMdiffrespweight takes both correct and incorrect response times into account and weights the distances of correct and incoreect response times with the relative frequencies of the data. WMdiffrespshift takes both correct and incorrect response times into account and assumes different non-decision times for no and yes responses. WMdiffrespshiftweight takes both correct and incorrect response times into account assuming different non-decision times for no and yes responses and weights the distances with the relative frequencies of the data.

Usage

WM(par, esterrorpar, c, k, pr, N, empRT, old=FALSE) 
WMdiffresp(par, esterrorpar, c, k, pr, N, empRT, empresp, old=FALSE,
           seed=0) 
WMdiffrespweight(par, esterrorpar, c, k, pr, N, empRT, empresp,
           old=FALSE, seed=0) 
WMdiffrespshift(par, esterrorpar, c, k, pr, N, empRT, empresp,
                old=FALSE, seed=0) 
WMdiffrespshiftweight(par, esterrorpar, c, k, pr, N, empRT, empresp,
                      old=FALSE, sep_shift = TRUE, wcorrect = NULL, seed=0) 

Arguments

par

A vector of length 3 or 4, equals (miat, mst, Tres) if non-decision time is assumed to be the same for no and yes responses (as in WM, WMdiffresp and WMdiffrespweight) and (miat, mst, Tresn, Tresy) otherwise (as in WMdiffrespshift and WMdiffrespshiftweight).

esterrorpar

A vector of length 5. Estimates of the accuracy-related parameters (\alpha, \beta, a_1, a_2, b)

c

A natural number representing the number of parallel servers of the system.

k

A natural number representing the total number of stimuli in the display (set size).

pr

Logical. If pr is TRUE, the function simulates data on target present trials; if pr is FALSE, it simulates data on target absent trials.

N

A natural number representing the number of simulation runs.

empRT

A vector of empirical response times collected under given target presence and set size condition.

empresp

A vector of empirical responses collected under given target presence and set size condition.

old

Logical. If old is TRUE, the simulation is implemented by R code; if old is FALSE, it is implemented by C code. Only for comparison of speed. Default option is FALSE.

sep_shift

Logical. Shall separate shifts be used for positive and negative answers?

wcorrect

Logical or NULL. Weighing of the positive responses in the convex combination of L_q distances between empirical and theoretical distributions for the positive and negativ answers separately.

seed

The random seed used in the simulation.

Value

A positive number. WMdiffresp returns the sum of the distances associated with correct and incorrect response times, WMdiffrespweight the sum of the weighted distances. WMdiffrespshift the sum of the distances associated with correct and incorrect response times, assuming different non-decision times for no and yes responses. WMdiffrespshiftweight the weighted sum.

Author(s)

Yiq Li, yiqi.li@web.de,https://www.xing.com/profile/Yiqi_Li3, Martin Schlather,martin.schlather@uni-mannheim.de,https://www.wim.uni-mannheim.de/schlather/

References

Li, Yiqi (2020) Visual search as a queueing process. Doctoral dissertation, University of Mannheim.

See Also

queue, LqDist, sim,

Examples

simdata1 <- sim.ny(par = c(30, 200, 250, 350), esterrorpar = c(-2.67, 0.0094,
0.0299, 0.0020, 1.13), c = 4, k = 12, N = 10000, pr = TRUE, seed = 0)

simdata2 <- sim.ny(par = c(30, 200, 250, 350), esterrorpar = c(-2.67, 0.0094,
0.0299, 0.0020, 1.13), c = 4, k = 12, N = 10000, pr = TRUE, seed =
12345)

WM(par = c(30, 200, 300), esterrorpar = c(-2.67, 0.0094,
0.0299, 0.0020, 1.13), c = 4, k = 12, pr = TRUE, N = 10000, empRT =
simdata2[,1], old=FALSE)

WMdiffresp(par = c(30, 200, 300), esterrorpar = c(-2.67, 0.0094,
0.0299, 0.0020, 1.13), c = 4, k = 12, pr = TRUE, N = 10000, empRT =
simdata2[,1], empresp = simdata2[,2], old=FALSE)

WMdiffrespweight(par = c(30, 200, 300), esterrorpar = c(-2.67, 0.0094,
0.0299, 0.0020, 1.13), c = 4, k = 12, pr = TRUE, N = 10000, empRT =
simdata2[,1], empresp = simdata2[,2], old=FALSE)

WMdiffrespshift(par = c(30, 200, 250, 350), esterrorpar = c(-2.67, 0.0094,
0.0299, 0.0020, 1.13), c = 4, k = 12, pr = TRUE, N = 10000, empRT =
simdata2[,1], empresp = simdata2[,2], old=FALSE)

WMdiffrespshiftweight(par = c(30, 200, 250, 350), esterrorpar = c(-2.67, 0.0094,
0.0299, 0.0020, 1.13), c = 4, k = 12, pr = TRUE, N = 10000, empRT =
simdata2[,1], empresp = simdata2[,2], old=FALSE) 

[Package qmvs version 0.2.0 Index]