lmds: Local MDS (Chen and Buja Style)

View source: R/lmds.R

lmdsR Documentation

Local MDS (Chen and Buja Style)

Description

This function minimizes the Local MDS Stress of Chen & Buja (2009) via gradient descent. This is a ratio metric scaling method.

Usage

lmds(
  delta,
  k = 2,
  tau = 1,
  type = "ratio",
  ndim = 2,
  weightmat = 1 - diag(nrow(delta)),
  itmax = 5000,
  acc = 1e-05,
  init = NULL,
  verbose = 0,
  principal = FALSE,
  normconf = FALSE
)

Arguments

delta

dissimilarity or distance matrix, dissimilarity or distance data frame or 'dist' object. All non-diagonal entries must be positive.

k

the k neighbourhood parameter

tau

the penalty parameter (suggested to be in [0,1])

type

what type of MDS to fit. Only "ratio" currently.

ndim

the dimension of the configuration

weightmat

a matrix of finite weights. Not implemented.

itmax

number of optimizing iterations, defaults to 5000.

acc

accuracy (lowest stepsize). Defaults to 1e-5.

init

initial configuration. If NULL a Torgerson scaling solution is used.

verbose

prints info if > 0 and progress if > 1.

principal

If 'TRUE', principal axis transformation is applied to the final configuration

normconf

normalize the configuration to sum(delta^2)=1 (as in the power stresses). Note that then the distances in confdist do not match the manually calculated ones.

Details

This should not be confused with Local MDS of Venna and Kaski (2006) as implemented in localmds.

Note that k and tau are not independent. It is possible for normalized stress to become negative if the tau and k combination is so that the absolute repulsion for the found configuration dominates the local stress substantially less than the repulsion term does for the solution of D(X)=Delta, so that the local stress difference between the found solution and perfect solution is nullified. This can typically be avoided if tau is between 0 and 1. If not, set k and or tau to a smaller value.

Note that input delta that are zero in the off-diagonals can make it impossible to calculate the gradient and then the program terminates and returns the gradient for inspection.

Value

an object of class 'lmds' (also inherits from 'smacofP'). See powerStressMin. It is a list with the components as in power stress

  • delta: Observed, untransformed dissimilarities

  • tdelta: Observed explicitly transformed dissimilarities, normalized

  • dhat: Explicitly transformed dissimilarities (dhats)

  • confdist: Configuration dissimilarities

  • conf: Matrix of fitted configuration

  • stress: Default stress (stress 1; sqrt of explicitly normalized stress)

  • ndim: Number of dimensions

  • model: Name of MDS model

  • type: Is "ratio" here.

  • niter: Number of iterations

  • nobj: Number of objects

  • pars: explicit transformations hyperparameter vector theta

  • weightmat: 1-diagonal matrix (for compatibility with smacof classes)

  • parameters, pars, theta: The parameters supplied

  • call the call

and some additional components

  • stress.m: default stress is the explicitly normalized stress on the normalized, transformed dissimilarities

  • tau: tau parameter

  • k: k parameter

Author(s)

Thomas Rusch based on code by Lisha Chen

Examples

dis<-smacof::kinshipdelta
res<- lmds(dis,k=2,tau=0.1)
res
summary(res)
plot(res)


smacofx documentation built on Oct. 22, 2026, 3:01 a.m.

Related to lmds in smacofx...