smacofConstraint {smacof} | R Documentation |
SMACOF with internal constraints on the configurations.
smacofConstraint(delta, constraint = "linear", external, ndim = 2, type = c("ratio", "interval", "ordinal", "mspline"), weightmat = NULL, init = NULL, ties = "primary", verbose = FALSE, modulus = 1, itmax = 1000, eps = 1e-6, spline.intKnots = 4, spline.degree = 2, constraint.type = c("ratio", "interval", "ordinal", "spline", "mspline"), constraint.ties = "primary", constraint.spline.intKnots = 2, constraint.spline.degree = 2)
delta |
Either a symmetric dissimilarity matrix or an object of class |
constraint |
Type of constraint: |
external |
Data frame or matrix with external covariates, or list for simplex and circumplex (see details) |
ndim |
Number of dimensions |
type |
MDS type: |
weightmat |
Optional matrix with dissimilarity weights |
init |
Optional matrix with starting values for configurations. If |
ties |
Tie specification for non-metric MDS only: |
verbose |
If |
modulus |
Number of smacof iterations per monotone regression call |
itmax |
Maximum number of iterations |
eps |
Convergence criterion |
spline.degree |
Degree of the spline for |
spline.intKnots |
Number of interior knots of the spline for |
constraint.type |
Transformation for |
constraint.ties |
Tie specification for |
constraint.spline.intKnots |
Number of interior knots for |
constraint.spline.degree |
Degree of the spline for |
The argument external
is mandatory and allows for the specification of a covariate data frame (or matrix) of dimension (n x q). Alternatively, for simplex fitting the user can specify a list of the following structure: external = list("simplex", dim2)
with dim2
denoting the dimension of the simplex with dim2 < n. For a circumplex fitting, the list has to be of the following form: external = list("circumplex", dim2, k1, k2)
with 1 ≤q k1 ≤q k2 ≤q n (see also examples section). k1 and k2 denote the circumplex width.
In constraint smacof, the configuration matrix is subject of a constraint based on the external scales (predictors). This constraint can be specified using the constraint
argument. We provide the following standard setting:
For constraint = "linear"
the configurations X are decomposed linearly, i.e. X = ZC where Z is the known predictor matrix specified using external
.
The same for constraint = "diagonal"
where X needs to be of dimension (n \times q) where q is the number of columns of the external scale matrix (and thus number of dimensions). Here, C is restricted to be diagonal.
For constraint = "linear"
or "diagonal"
, the external covariates Z can be optimally transformed as specified by constraint.type
. Choosing the number of covariates equal to the number of dimensions together with constraint.type = "ordinal"
, constraint.ties = "primary"
will effectively restrict the configuration to parallel regions defined by the categories of the covariates. Note that missing values of the covariates are estimated by the model.
For constraint = "unique"
we get the Bentler-Weeks uniqueness model. Hence X is of dimension (n x (n + p)). This implies that we fit a certain number of dimensions p and, in addition we extract n additional dimensions where each object is scored on a separate dimension. More technical details can be found in the corresponding JSS article (reference see below).
In addition, the user can specify his own constraint function with the following arguments: configuration matrix with starting values (init
) (mandatory in this case), matrix V (weightmat
; based on the weight matrix, see package vignette), external scale matrix (external
). The function must return a matrix of resulting configurations.
If no starting configuration is provided, a random starting solution is used. In most applications, this is not a good idea in order
to find a good fitting model. The user can fit an exploratory MDS using mds()
first and use the resulting configurations
as starting configuration for smacofConstraint()
. Alternatively, if the user has starting configurations determined by
some underlying theory, they can be used as well.
delta |
Observed dissimilarities |
obsdiss |
Observed dissimilarities, normalized |
confdist |
Configuration dissimilarities |
conf |
Matrix of final configurations |
C |
Matrix with restrictions |
stress |
Stress-1 value |
spp |
Stress per point |
resmat |
Matrix with squared residuals |
rss |
Residual sum-of-squares |
weightmat |
Weight matrix |
ndim |
Number of dimensions |
extvars |
List for each external covariate with a list of class |
init |
Starting configuration |
model |
Type of smacof model |
niter |
Number of iterations |
nobj |
Number of objects |
Jan de Leeuw and Patrick Mair
De Leeuw, J. & Mair, P. (2009). Multidimensional scaling using majorization: The R package smacof. Journal of Statistical Software, 31(3), 1-30, http://www.jstatsoft.org/v31/i03/
De Leeuw, J., & Heiser, W. (1980). Multidimensional scaling with restrictions on the configurations. In P. R. Krishnaiah (eds.), Multivariate Analysis V, pp. 501-522. North-Holland.
Borg, I., & Lingoes, J. C. (1980). A model and algorithm for multidimensional scaling with external constraints on the distances. Psychometrika, 45, 25-38.
smacofSym
, smacofRect
, smacofIndDiff
, smacofSphere
## theoretical grid restrictions (rectangles; keep covariate ties tied) fit.rect1 <- mds(rectangles, type = "ordinal", init = rect_constr) fit.rect2 <- smacofConstraint(rectangles, type = "ordinal", ties = "secondary", constraint="diagonal", init = fit.rect1$conf, external = rect_constr, constraint.type = "ordinal") plot(fit.rect2) ## regional restrictions morse code data (signal length, strength) fitMorse1 <- mds(morse, type = "ordinal") fitMorse1 fitMorse2 <- smacofConstraint(morse, type = "ordinal", constraint = "linear", external = morsescales[,2:3], constraint.type = "ordinal", init = fitMorse1$conf) fitMorse2 plot(fitMorse2) ## regional restrictions OCP data ocpD <- sim2diss(OCP[,1:54]) fit.ocp1 <- mds(ocpD, type = "ordinal") ## unrestricted fit (for starting solution) Z <- OCP[,56:57] fit.ocp2 <- smacofConstraint(ocpD, type = "ordinal", constraint = "diagonal", init = fit.ocp1$conf, external = Z, constraint.type = "ordinal") fit.ocp2 plot(fit.ocp2)