smacofRect: Nonmetric unfolding

Description Usage Arguments Details Value Author(s) References See Also Examples

View source: R/smacofRect.R

Description

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

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
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)

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".

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 λ = 0.5 and ω = 1.0 (for unconditional solutions ω 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.

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)

Author(s)

Patrick Groenen, Jan de Leeuw and Patrick Mair

References

de Leeuw, J. & Mair, P. (2009). Multidimensional scaling using majorization: The R package smacof. Journal of Statistical Software, 31(3), 1-30, https://www.jstatsoft.org/v31/i03/

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

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
## 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")

## Not run: 
## 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)

## End(Not run)

Example output

Loading required package: plotrix
Loading required package: colorspace
Loading required package: e1071

Attaching package:smacofThe following object is masked frompackage:base:

    transform


Call: unfolding(delta = breakfast)

Model:               Rectangular smacof 
Number of subjects:  42 
Number of objects:   15 
Transformation:      none 
Conditionality:      matrix 

Stress-1 value:    0.308625 
Penalized Stress:  3.525172 
Number of iterations: 50 

Warning message:
In unfolding(breakfast, type = "ordinal", conditionality = "row",  :
  Iteration limit reached! Increase itmax argument!

Call: unfolding(delta = breakfast, type = "ordinal", conditionality = "row", 
    omega = 0.1, itmax = 3000)

Model:               Rectangular smacof 
Number of subjects:  42 
Number of objects:   15 
Transformation:      ordinalp 
Conditionality:      row 

Stress-1 value:    0.117478 
Penalized Stress:  5.171487 
Number of iterations: 3000 

smacof documentation built on Feb. 11, 2021, 3 a.m.