Learn R Programming

smacof (version 2.1-6)

unfolding: Nonmetric unfolding

Description

Variant of smacof for rectangular matrices (typically ratings, preferences) that allows for nonmetric transformations. Also known as nonmetric unfolding.

Usage

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)

Value

obsdiss

Observed dissimilarities, corresponds to delta

confdist

Configuration dissimilarities

dhat

Matrix with optimal transformation of size delta

iord

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

conf.row

Matrix of final row configurations

conf.col

Matrix of final column configurations

stress

Final, normalized stress value

pstress

Penalized stress value (the criterion that is minimized)

spp.row

Stress per point, rows

spp.col

Stress per point, columns

congvec

Vector of congruency coefficients

ndim

Number of dimensions

model

Type of smacof model

niter

Number of iterations

nind

Number of individuals (rows)

trans

Transformation

conditionality

Conditionality of the transformation

nobj

Number of objects (columns)

Arguments

delta

Data frame or matrix of preferences, ratings, dissimilarities.

ndim

Number of dimensions.

type

MDS type: "interval", "ratio", "ordinal", or "mspline".

conditionality

A single transformations are applied for the entire matrix "unconditional", or for each row separately "row".

lambda

Penalty strength balancing the loss contribution of stress and the penalty (see details).

omega

Penalty width determines for what values of the variation coefficient the penalty should become active (see details).

circle

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

weightmat

Optional matrix with dissimilarity weights.

init

Optional list of length two with starting values for the row coordinates (first element) and column coordinates (second element).

fixed

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.

fixed.coord

Matrix with fixed coordinates of the appropriate size.

ties

Tie specification for ordinal transformations: primary unties the ties and secondary keeps the ties tied.

verbose

If TRUE, intermediate stress is printed out.

relax

If TRUE, block relaxation is used for majorization after 100 iterations. It tends to reduce the number of iterations by a factor 2.

itmax

Maximum number of iterations.

eps

Convergence criterion.

spline.degree

Degree of the spline for an "mspline" transformation.

spline.intKnots

Number of interior knots of the spline for a "mspline" transformation.

parallelize

Tries to parallelize the computations when conditionality = "row".

Author

Patrick Groenen, Jan de Leeuw and Patrick Mair

Details

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.

References

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.

See Also

plot.smacof, smacofConstraint, smacofSym, smacofIndDiff, smacofSphere

Examples

Run this code
## 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