Variant of smacof for rectangular matrices (typically ratings, preferences) that allows for nonmetric transformations. Also known as nonmetric unfolding.
unfolding(delta, ndim = 2, type = c("ratio", "interval", "ordinal", "mspline"),
conditionality = "unconditional", lambda = 0.5, omega = 1,
circle = c("none", "row", "column"), weightmat = NULL, init = NULL,
fixed = c("none", "row", "column"), fixed.coord = NULL,
ties = c("primary", "secondary"), verbose = FALSE, relax = TRUE,
itmax = 10000, eps = 1e-6, spline.degree = 2, spline.intKnots = 2,
parallelize = FALSE)smacofRect(delta, ndim = 2, type = c("ratio", "interval", "ordinal", "mspline"),
conditionality = "unconditional", lambda = 0.5, omega = 1,
circle = c("none", "row", "column"), weightmat = NULL, init = NULL,
fixed = c("none", "row", "column"), fixed.coord = NULL,
ties = c("primary", "secondary"), verbose = FALSE, relax = TRUE,
itmax = 10000, eps = 1e-6, spline.degree = 2, spline.intKnots = 2,
parallelize = FALSE)
prefscal(delta, ndim = 2, type = c("ratio", "interval", "ordinal", "mspline"),
conditionality = "unconditional", lambda = 0.5, omega = 1,
circle = c("none", "row", "column"), weightmat = NULL, init = NULL,
fixed = c("none", "row", "column"), fixed.coord = NULL,
ties = c("primary", "secondary"), verbose = FALSE, relax = TRUE,
itmax = 10000, eps = 1e-6, spline.degree = 2, spline.intKnots = 2,
parallelize = FALSE)
Observed dissimilarities, corresponds to delta
Configuration dissimilarities
Matrix with optimal transformation of size delta
List of size 1 for matrix conditional and size nrow(delta)
for row conditional with the index that orders the dhats. Needed for the Shepard plot
Matrix of final row configurations
Matrix of final column configurations
Final, normalized stress value
Penalized stress value (the criterion that is minimized)
Stress per point, rows
Stress per point, columns
Vector of congruency coefficients
Number of dimensions
Type of smacof model
Number of iterations
Number of individuals (rows)
Transformation
Conditionality of the transformation
Number of objects (columns)
Data frame or matrix of preferences, ratings, dissimilarities.
Number of dimensions.
MDS type: "interval"
, "ratio"
, "ordinal"
, or "mspline"
.
A single transformations are applied for the entire matrix "unconditional"
, or for each row separately "row"
.
Penalty strength balancing the loss contribution of stress and the penalty (see details).
Penalty width determines for what values of the variation coefficient the penalty should become active (see details).
If "column"
, the column configurations are restricted to be on a circle, if "row"
, row configurations are on a circle, if "none"
, there are no restrictions on row and column configurations
Optional matrix with dissimilarity weights.
Optional list of length two with starting values for the row coordinates (first element) and column coordinates (second element).
Do external unfolding by fixing the row
coordinates, column
coordinate, or choose none
(default) to do normal unfolding. Even fixed coordinates are uniformly scaled by a constant to fit the loss function.
Matrix with fixed coordinates of the appropriate size.
Tie specification for ordinal
transformations: primary
unties the ties and secondary
keeps the ties tied.
If TRUE
, intermediate stress is printed out.
If TRUE
, block relaxation is used for majorization after 100 iterations. It tends to reduce the number of iterations by a factor 2.
Maximum number of iterations.
Convergence criterion.
Degree of the spline for an "mspline"
transformation.
Number of interior knots of the spline for a "mspline"
transformation.
Tries to parallelize the computations when conditionality = "row"
.
Patrick Groenen, Jan de Leeuw and Patrick Mair
Unfolding tries to match a rectangular matrix delta
of dissimilarities between row and column objects by Euclidean distances between row and column points. Badness of fit is measured by raw Stress as the sum of squared differences between delta
and the Euclidean distances. Instead of dissimilarities optimal transformations (dhats) can be found. The dhats should be a function of the original delta
restricted to be "ratio"
, "interval"
, "ordinal"
, or "mspline"
. These transformations can be the same for the entire matrix (conditionality = "unconditional"
) of data, or different per row (conditionality = "row"
). To avoid a degenerate solution with all dhats and distances equal to 1, the prefscal penalty is is used.
A penalty is added based on the variation coefficient of the dhats (mean dhat divided by the standard deviation of the dhats). The penalty width (omega
) weights the penalty and determines from what value of the variation coefficient of the dhats the penalty should become active. The penalty strength (lambda
) is needed to ensure that the penalty can be strong enough. Busing et al. (2005) suggest to use \(\lambda = 0.5\) and \(\omega = 1.0\) (for unconditional solutions \(\omega\) can be lowered to a value as low as 0.1).
External unfolding can be done by specifying fixed = "row"
or "column"
and providing the fixed coordinates in fixed.coord
. Then, either the rows or columns are fixed up to a uniform constant.
Creates an object of class smacofR
.
De Leeuw, J. & Mair, P. (2009). Multidimensional scaling using majorization: The R package smacof. Journal of Statistical Software, 31(3), 1-30, tools:::Rd_expr_doi("10.18637/jss.v031.i03")
Mair, P., Groenen, P. J. F., De Leeuw, J. (2022). More on multidimensional scaling in R: smacof version 2. Journal of Statistical Software, 102(10), 1-47. tools:::Rd_expr_doi("10.18637/jss.v102.i10")
Busing, F. M. T. A., Groenen, P. J. F., & Heiser, W. J. (2005). Avoiding degeneracy in multidimensional unfolding by penalizing on the coefficient of variation. Psychometrika, 70, 71-98.
plot.smacof
, smacofConstraint
, smacofSym
, smacofIndDiff
, smacofSphere
## Ratio unfolding
res <- unfolding(breakfast)
res
## various configuration plots
plot(res)
plot(res, type = "p", pch = 25)
plot(res, type = "p", pch = 25, col.columns = 3,
label.conf.columns = list(label = TRUE, pos = 3, col = 3),
col.rows = 8, label.conf.rows = list(label = TRUE, pos = 3, col = 8))
## Shepard plot
plot(res, "Shepard")
## Stress decomposition chart
plot(res, "stressplot")
if (FALSE) {
## Ordinal unfolding, row-conditional
## Note that ordinal unfolding may need many iterations (several thousands)
res <- unfolding(breakfast, type = "ordinal", conditionality = "row", omega = 0.1, itmax = 3000)
res
plot(res, "Shepard") ## Shepard plot
plot(res)
}
Run the code above in your browser using DataLab