mlds
uses different methods to fit the results of a difference scaling experiment either using glm
(Generalized Linear Model), by direct maximization of the likelihood using optim
or by maximizing the likelihood with respect to a function of the stimulus dimension specified by a one sided formula.mlds(x, ...)## S3 method for class 'default':
mlds(x, stimulus = NULL, method = "glm",
lnk = "probit", opt.meth = "BFGS", opt.init = NULL,
control = glm.control(maxit = 50000, epsilon = 1e-14),
... )
## S3 method for class 'formula':
mlds(x, p, data, stimulus = NULL,
lnk = "probit", opt.meth = "BFGS",
control = list(maxit = 50000, reltol = 1e-14), ... )
method
is specified as formula
argument that specifies initial values for the parameters. The extra parameter, specified last, is the initial estimate of sigma
.data
is of class NULL
, a sequence of 1-n is used, where n is the method
= optim
can be specified. Defaults to glm
or optim
. Since the method
defaults to glm
or optim.
optim
converged or not. See optim
.formula
.mlds
estimates numbers, $Psi_1,..., Psi_n$, by maximum likelihood such that $(Psi_d - Psi_c) > (Psi_b - Psi_a)$ when the observer chooses pair 2, and pair 1, otherwise.
If there are $p$ stimulus levels tested, then $p - 1$ coefficients are estimated. The sigma
, whereas this value is fixed at 1.0 for the sigma
estimated with the Knoblauch, K. and Maloney, L. T. (2008) MLDS: Maximum likelihood difference scaling in R.
Journal of Statistical Software, 25:2, 1--26,
glm
, optim
data(AutumnLab)
#Note the warnings generated by glm method
x.mlds <- mlds(AutumnLab)
summary(x.mlds)
y.mlds <- mlds(AutumnLab, method = "optim", opt.init = c(seq(0, 1, len = 10), 0.16))
summary(y.mlds)
plot(x.mlds)
#How sigma relates the scales obtained by the 2 different methods.
lines(y.mlds$stimulus, y.mlds$pscale/y.mlds$sigma)
#An example using the formula method
data(kk1)
# with one parameter
kk.frm1 <- mlds(~ sx^p, p = c(3, 0.02), data = kk1)
# with two parameters
kk.frm2 <- mlds(~p[1] * (sx + abs(sx - p[2])) - p[1] * p[2],
p = c(0.9, 0.3, 0.2), data = kk1)
Run the code above in your browser using DataLab