Learn R Programming

fmds (version 0.1.5)

fastmds: Multidimensional Scaling Function

Description

fastmds performs multidimensional scaling. The function follows algorithms given by de Leeuw and Heiser (1980). The data, dissimilarities and weights, are either symmetric or asymmetric. The dissimilarities are may contain negative values, the weights may not. The configuration is either unrestricted, (partly) fixed, or a linear combination of independent variables, penalized or not.

Usage

fastmds(
  delta,
  w = NULL,
  p = 2,
  z = NULL,
  r = NULL,
  b = NULL,
  anchor = 0,
  lambda = 0,
  alpha = 1,
  grouped = FALSE,
  MAXITER = 1024,
  FCRIT = 1e-08,
  ZCRIT = 1e-06,
  rotate = TRUE,
  faster = FALSE,
  error.check = FALSE,
  echo = FALSE
)

Value

data original n by n matrix with dissimilarities.

weights original n by n matrix with weights.

coordinates final n by p matrix with coordinates.

restriction either the fixed coordinates or the independent variables.

coefficients final h by p matrix with regression coefficients.

lambda (optimal) penalty parameter.

alpha elastic-net penalty parameter.

grouped common or grouped lasso penalty.

distances final n by n matrix with Euclidean distances between n rows of coordinates.

last.iteration final iteration number.

last.difference final function difference used for convergence testing.

n.stress final normalized stress value.

rotate if solution is rotated to principal axes.

Arguments

delta

an n by n squares hollow matrix containing dissimilarities.

w

an identical sized matrix containing non-negative weights (all ones when omitted).

p

dimensionality (default = 2).

z

n by p matrix with initial coordinates.

r

restrictions on the configuration, either an n by p matrix with booleans indicating free (false) and fixed (true) coordinates or an n by h numerical matrix with h independent variables.

b

h by p matrix with initial regression coefficients.

anchor

used as additive constant, but estimated for pcoa only when anchor == NA.

lambda

regularization penalty parameter (default = 0.0: no penalty).

alpha

elastic-net parameter (default = 1.0: lasso only).

grouped

boolean for grouped lasso penalty (default = FALSE: ordinary lasso).

MAXITER

maximum number of iterations (default = 1024).

FCRIT

relative convergence criterion function value (default = 0.00000001).

ZCRIT

absolute convergence criterion coordinates (default = 0.000001).

rotate

if TRUE: solution is rotated to principal axes.

faster

logical indicating faster but less precise procedure

error.check

extensive validity check input parameters (default = FALSE).

echo

print intermediate algorithm results (default = FALSE).

Author

Frank M.T.A. Busing

References

de Leeuw, J., and Heiser, W. J. (1980). Multidimensional scaling with restrictions on the configuration. In P.R. Krishnaiah (Ed.), Multivariate analysis (Vol. 5, pp. 501–522). Amsterdam, The Netherlands: North-Holland Publishing Company.

Heiser, W.J. (1991). A generalized majorization method for least squares multidimensional scaling of pseudo-distances that may be negative. Psychometrika, 55, pages 7-27.

Busing, F.M.T.A. (submitted). Node Localization by Multidimensional Scaling with Iterative Majorization: A Psychometric Perspective. Signal Processing, Elsevier.

Examples

Run this code
data( "colors" )
delta <- as.matrix( ( colors )^3 )
n <- nrow( delta )
w <- 1 - diag( n )
p <- 2
zinit <- matrix( runif( n * p ), n, p )
#r <- fastmds( delta, w, p, z = zinit, echo = TRUE )

Run the code above in your browser using DataLab