Title: | Fitting a Quadrilateral Dissimilarity Model to Same-Different Judgments |
---|---|
Description: | This package provides different specifications of a Quadrilateral Dissimilarity Model which can be used to fit same-different judgments in order to get a predicted matrix that satisfies regular minimality [Colonius & Dzhafarov, 2006, Measurement and representations of sensations, Erlbaum]. From such a matrix, Fechnerian distances can be computed. |
Authors: | Nora Umbach [aut, cre], Florian Wickelmaier [aut] |
Maintainer: | Nora Umbach <[email protected]> |
License: | GPL (>= 2) |
Version: | 0.1-0 |
Built: | 2024-12-01 08:42:30 UTC |
Source: | CRAN |
Three subjects were repeatedly presented with all possible pairs of nine frequency-modulated (FM) tones. The tones had one out of nine different modulation rates, a random modulation phase, a duration of 500 ms, a sound pressure level of 60 dB, and a center frequency of 1000 Hz.
On each trial, subjects judged whether the two FM tones sounded same or different.
data(FMrate)
data(FMrate)
A data frame of eight variables and 26,820 observations:
resp
the response of a subject in each trial, either
s
for same or d
for different.
RT
reaction time from stimulus onset until reaction of subject.
id
subject id.
ses
number of experimental session.
s1
stimulus (FM rate in Hz) which was presented in the first observation area; in this case: first.
s2
stimulus (FM rate in Hz) which was presented in the second observation area.
phi1
random modulation phase shift for stimulus presented in the first observation area.
phi2
random modulation phase shift for stimulus presented in the second observation area.
Umbach, N., & Wickelmaier, F. (2014). Violations of regular minimality in discrimination judgments of frequency-modulated tones. Presented at the 45th European Mathematical Psychology Group (EMPG) Meeting, July 30 to August 1, Tuebingen, Germany.
data(FMrate) xtabs(~ id + ses, FMrate)
data(FMrate) xtabs(~ id + ses, FMrate)
Four subjects were repeatedly presented with all possible pairs of nine gray patches presented under a constant illumination of 133.27 cd/m^2. Stimuli had a size of 0.81 degrees of visual angle and were presented side by side with a distance of 2.32 degrees of visual angle.
On each trial, subjects judged whether the two patches looked same or different.
data(lightness)
data(lightness)
A data frame of seven variables and 35,760 observations:
resp
the response of a subject in each trial, either s
for same or d
for different.
RT
reaction time from stimulus onset until reaction of subject.
id
subject id.
ses
number of experimental session.
s1
stimulus which was presented in the first observation area; in this case: on the left side of the monitor.
s2
stimulus which was presented in the second observation area.
key
which mouse button was pressed. Assigment of same and different to the mouse buttons varied between subjects.
Umbach, N (2013). Dimensionality of the Perceptual Space of Achromatic Surface Colors. Dissertation, University of Tuebingen.
data(lightness) xtabs(~ id + ses, lightness)
data(lightness) xtabs(~ id + ses, lightness)
Draws a perspective plot of the predictions of a Quadrilateral
Dissimilarity Model fitted with qdm
.
## S3 method for class 'qdm' persp(x, col = "gray", zlim = 0:1, phi = 10, theta = -25, xlab = "OA1", ylab = "OA2", zlab = "Predictions", ...)
## S3 method for class 'qdm' persp(x, col = "gray", zlim = 0:1, phi = 10, theta = -25, xlab = "OA1", ylab = "OA2", zlab = "Predictions", ...)
x |
object of class 'qdm'. See |
col |
the color(s) of the surface facets. Transparent colours are ignored. This is recycled to the (nx-1)(ny-1) facets. |
zlim |
Defaults to zlim=c(0,1) since probabilities are plotted. |
theta , phi
|
angles defining the viewing direction. 'theta' gives the azimuthal direction and 'phi' the colatitude. |
xlab , ylab , zlab
|
titles for the axes. N.B. These must be character strings; expressions are not accepted. Numbers will be coerced to character strings. |
... |
additional graphical parameters (see 'par'). |
Predicts regular minimality compliant discrimination probabilities for a
model fitted with qdm
.
## S3 method for class 'qdm' predict(object, x = object$psi$x, y = object$psi$y, respfun = object$respfun, bias = object$bias, ...)
## S3 method for class 'qdm' predict(object, x = object$psi$x, y = object$psi$y, respfun = object$respfun, bias = object$bias, ...)
object |
object of class "qdm". See |
x |
stimulus intensities for the first observation area. Defaults to the values used for fitting the model. |
y |
stimulus intensities for the second observation area. Defaults to the values used for fitting the model. |
respfun |
function used to describe relationship
between discrimination probabilities and similarity measure. Defaults to
the function used for fitting the model. See |
bias |
perceptual bias of subject. Defaults to the bias used for fitting the model. |
... |
additional arguments. |
Creates matrices with discrimination probabilities, number of trials, number of different answers, and stimulus intensities from a data frame.
psi(data, oa1 = "s1", oa2 = "s2", resp = "resp")
psi(data, oa1 = "s1", oa2 = "s2", resp = "resp")
data |
data frame with repeated same-different judgments. |
oa1 , oa2
|
name of the variable that contains the stimulus intensities in the first and second observation area. |
resp |
name of response variable for same-different judgments;
answers have to be |
The data frame must include at least a column for the response and one
column each for observation areas one and two. The return value of
psi
may serve as an input to qdm
that fits a
quadrilateral dissimilarity model to the judgments.
An object of class psi
that consists of the following components:
prob |
a matrix of discrimination probabilities per stimulus combination. |
ntrials |
a matrix of number of trials per stimulus combination. |
freq |
a matrix of frequencies of different answers per stimulus combination. |
x , y
|
(if possible numeric) vectors of stimulus intensities. |
qdm
.
data(FMrate) psi1 <- psi(FMrate[FMrate$id == "subj1",])
data(FMrate) psi1 <- psi(FMrate[FMrate$id == "subj1",])
Fits a Quadrilateral Dissimilarity Model to same-different data.
qdm(psi, start, respfun = c("logistic", "guessing", "gumbel", "gompertz", "weibull", "cauchy", "shepardA", "shepardAneg", "shepardB", "shepardBneg", "shepardD", "shepardDneg", "shepardE", "shepardEneg", "shepardF", "shepardFneg"), bias = 0, estimfun = c("minchi2", "ols", "wls"), optimizer = c("optim", "nlm"), optimargs = list())
qdm(psi, start, respfun = c("logistic", "guessing", "gumbel", "gompertz", "weibull", "cauchy", "shepardA", "shepardAneg", "shepardB", "shepardBneg", "shepardD", "shepardDneg", "shepardE", "shepardEneg", "shepardF", "shepardFneg"), bias = 0, estimfun = c("minchi2", "ols", "wls"), optimizer = c("optim", "nlm"), optimargs = list())
psi |
data object created with |
start |
starting values for parameter estimation. |
respfun |
function that describes relationship between discrimination probabilities and similarity measure, see Details. |
bias |
takes perceptual bias into account. Default is 0. |
estimfun |
method to estimate parameters, see Details. |
optimizer |
|
optimargs |
More details about the Quadrilateral Dissimilarity Model can be found in Dzhafarov and Colonius (2006).
Via respfun
, different functions can be selected to describe the
relationship between discrimination probabilities and dissimilarity
measure. Implemented are the logistic function (logistic
),
the logistic function with guessing parameter (guessing
), several
other functions commonly used as psychometric functions (gumbel
,
gompertz
, weibull
, cauchy
), and five functions
suggested by Shepard (1987) (shepardA
, shepardB
,
shepardD
, shepardE
, shepardF
) and their negatives
(shepardAneg
, shepardBneg
, shepardDneg
shepardEneg
, shepardFneg
). Default is the logistic
function. Note that for some of these functions the results critically
depend on the choice of the starting values.
Parameters can be estimated by using different minimizing functions
available via the estimfun
argument: ordinary least squares
(ols
), weighted least squares (wls
), and minimization of
Pearson's (
minchi2
). Default is the minimization of
.
An object of class qdm
that consists of the following components:
optimout |
|
coefficients |
estimated parameters. |
psi |
|
respfun |
function used to describe relationship between discrimination probabilities and similarity measure. |
bias |
perceptual bias used in the model. |
Dzhafarov, E. N., & Colonius, H. (2006). Regular Minimality: A fundamental law of discrimination. In H. Colonius & E. N. Dzhafarov (Eds.), Measurement and representation of sensations (pp. 1–46). Hillsdale, NJ: Lawrence Erlbaum Associates.
Shepard, R. N. (1987). Towards a universal law of generalization for psychological science. Science, 237, 1317–1323.
psi
, predict.qdm
, persp.qdm
,
nlm
, optim
.
## prepare data data(FMrate) psi1 <- psi(FMrate[FMrate$id == "subj1",]) ## estimate model p.s <- c(.2, .5, .1, .5, .3, .1, .1, .1) q1 <- qdm(psi1, start=p.s) print(q1) ## model predictions predict(q1) persp(q1)
## prepare data data(FMrate) psi1 <- psi(FMrate[FMrate$id == "subj1",]) ## estimate model p.s <- c(.2, .5, .1, .5, .3, .1, .1, .1) q1 <- qdm(psi1, start=p.s) print(q1) ## model predictions predict(q1) persp(q1)