driftVectors: Asymmetric MDS: Drift Vectors

View source: R/driftVectors.R

driftVectorsR Documentation

Asymmetric MDS: Drift Vectors

Description

Takes an asymmetric dissimilarity matrix and decomposes it into a symmetric and a skew-symmetric part. Fits an MDS on the symmetric part and computes drift vectors for the skew-symmetric portion. This model makes it possible to see how these two components are related to each other. It is limited to two dimensions only.

Usage

driftVectors(data, type = c("ratio", "interval", "ordinal","mspline"), 
             weightmat = NULL, init = "torgerson", ties = "primary",  verbose = FALSE, 
             relax = FALSE, modulus = 1, itmax = 1000, eps = 1e-6, 
             spline.degree = 2, spline.intKnots = 2)
             
## S3 method for class 'driftvec'
plot(x, adjust = 1, main, xlim, ylim, 
                        xlab = "Dimension 1", ylab = "Dimension 2", pch = 20, asp = 1, 
                        col.conf = "black", col.drift = "lightgray", 
                        label.conf = list(label = TRUE, pos = 3, col = "black", 
                        cex = 0.8), ...) 

Arguments

data

Asymmetric dissimilarity matrix

weightmat

Optional matrix with dissimilarity weights

init

Either "torgerson" (classical scaling starting solution), "random" (random configuration), or a user-defined matrix

type

MDS type: "interval", "ratio", "ordinal" (nonmetric MDS), or "mspline"

ties

Tie specification for ordinal MDS only: "primary", "secondary", or "tertiary"

verbose

If TRUE, intermediate stress is printed out

relax

If TRUE, block relaxation is used for majorization

modulus

Number of smacof iterations per monotone regression call

itmax

Maximum number of iterations

eps

Convergence criterion

spline.degree

Degree of the spline for "mspline" MDS type

spline.intKnots

Number of interior knots of the spline for "mspline" MDS type

x

Object of class "driftvec"

adjust

Scaling factor for drift vectors (value larger than 1 increases the length)

main

Plot title

xlab

Label of x-axis

ylab

Label of y-axis

xlim

Scale x-axis

ylim

Scale y-axis

pch

Plot symbol

asp

Aspect ratio

col.conf

Point color (MDS configurations)

col.drift

Color for drift vectors (arrows)

label.conf

Settings for plotting labels

...

Additional plotting arguments

Details

The skew-symmetric values are embedded into the MDS representation of the symmetrized data by drawing errors (drift vectors) from each point i to each point j in the configuration so that these vectors correspond in length and direction to the values of row i of the skew-symmetric matrix.

Value

fitsym

MDS output for symmetric portion

sym

Symmetric matrix

skewsym

Skew-symmetric matrix

driftcoor

Drift vector coordinates

stress

Stress-1 value

niter

Number of iterations

nobj

Number of objects

Author(s)

Patrick Mair

References

Borg, I., & Groenen, P. J. F. (2005). Modern Multidimensional Scaling (2nd ed.). Springer.

See Also

smacofSym

Examples

## simple example
P <- matrix(c(0,  4,  6, 13, 
              5,  0, 37, 21, 
              4, 38,  0, 16, 
              8, 31, 18,  0), nrow = 4, ncol = 4, byrow = TRUE) 
D <- sim2diss(P, method = 40) 
res <- driftVectors(D, type = "interval")
plot(res)
plot(res, adjust = 0.1)    ## shorten drift vectors 

## Morse code data
fit.drift <- driftVectors(morse2, type = "ordinal")
fit.drift
plot(fit.drift)

smacof documentation built on Oct. 10, 2024, 5:09 p.m.