distance: Calculation of the Wasserstein metric between an empirical...

distanceR 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 \par
esterrorpar \esterrorpar
c \c
k \k
pr \pr
N \N
empRT \empRT
empresp

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

old \old
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 \seed

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)

\both

References

\yiqiDiss

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) 

qmvs documentation built on Nov. 4, 2024, 9:06 a.m.

Related to distance in qmvs...