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 dQuote{glm}, the default is a glm list but should be changed if the dQuote{optim} method is chosen.glm
or optim.
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 , whereas this value is fixed at 1.0 for the glm method. In principle, the scales from the two methods are related by
$$1/\sigma_o = max(Psi_g)$$
where $\sigma_o$ is estimated with the optim method and $Psi_g$ corresponds to the perceptual scale values estimated with the glm method. The equality may not be exact as the optim method prevents the selection of values outside of the interval [0, 1] whereas the glm method does not.
A list of class mlds whose components depend on whether the method was specified as glm , optim with the default method, or the formula method was used,
- pscale
{A numeric vector of the estimated difference scale.}
- stimulus
{The physical stimulus levels}
- sigma
{The scale estimate, always 1.0 for glm }
- method
{The fitting method}
- link
{The binomial link specified, default probit }
- obj
{For method glm , an object of class glm resulting from the fit.}
- logLik
{for method optim , the logarithm of likelihood at convergence}
- hess
{for method optim , the Hessian matrix at convergence}
- data
{For methodoptim , the data.frame or mlds.df entered as an argument.}
- conv
{For method optim , a code indicating whether optim
converged or not. See optim
.}
- par
{For formula method, the parameters estimated.}
- formula
{The one-sided formula specified with the method .}
- func
{For formula method, a function obtained from the one-sided formula
.}
Maloney, L. T. and Yang, J. N. (2003). Maximum likelihood difference scaling. Journal of Vision, 3(8):5, 573--585, http://journalofvision.org/3/8/5/ , doi:10.1167/3.8.5.
[object Object],[object Object]
The glm method often generates warnings that fitted probabilities are 0 or 1. This does not usually affect the values of the estimated scale. However, it may be wise to check the results with the optim method and obtain standard errors from a bootstrap method (see boot.mlds
. The warnings will often disappear if the link is modified or more data are obtained.
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)
models
regression
nonlinear