Learn R Programming

smacofx (version 1.21-1)

rStressMin: R stress SMACOF

Description

An implementation to minimize r-stress by majorization with ratio, interval, monotonic spline and ordinal optimal scaling. Uses a repeat loop.

Usage

rStressMin(
  delta,
  r = 0.5,
  type = c("ratio", "interval", "ordinal", "mspline"),
  ties = "primary",
  weightmat = 1 - diag(nrow(delta)),
  init = NULL,
  ndim = 2,
  acc = 1e-06,
  itmax = 10000,
  verbose = FALSE,
  principal = FALSE,
  spline.degree = 2,
  spline.intKnots = 2
)

rstressMin( delta, r = 0.5, type = c("ratio", "interval", "ordinal", "mspline"), ties = "primary", weightmat = 1 - diag(nrow(delta)), init = NULL, ndim = 2, acc = 1e-06, itmax = 10000, verbose = FALSE, principal = FALSE, spline.degree = 2, spline.intKnots = 2 )

rstressmds( delta, r = 0.5, type = c("ratio", "interval", "ordinal", "mspline"), ties = "primary", weightmat = 1 - diag(nrow(delta)), init = NULL, ndim = 2, acc = 1e-06, itmax = 10000, verbose = FALSE, principal = FALSE, spline.degree = 2, spline.intKnots = 2 )

rstress( delta, r = 0.5, type = c("ratio", "interval", "ordinal", "mspline"), ties = "primary", weightmat = 1 - diag(nrow(delta)), init = NULL, ndim = 2, acc = 1e-06, itmax = 10000, verbose = FALSE, principal = FALSE, spline.degree = 2, spline.intKnots = 2 )

Value

a 'smacofP' object (inheriting from 'smacofB', see smacofSym). It is a list with the components

  • delta: Observed, untransformed dissimilarities

  • tdelta: Observed explicitly transformed dissimilarities, normalized

  • dhat: Explicitly transformed dissimilarities (dhats), optimally scaled and normalized

  • confdist: Transformed fitted configuration distances

  • iord: Optimally scaled disparities function

  • conf: Matrix of fitted configuration

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

  • spp: Stress per point

  • ndim: Number of dimensions

  • weightmat: Weighting matrix as supplied

  • resmat: Residual matrix

  • rss: Sum of residuals

  • init: The starting configuration

  • model: Name of MDS model

  • niter: Number of iterations

  • nobj: Number of objects

  • type: Type of optimal scaling

  • call : the matched call

  • stress.m: Default stress (stress-1^2)

  • alpha: Alpha matrix

  • sigma: Stress

  • parameters, pars, theta: Optimal transformation parameter

  • tweightmat: Transformed weighting matrix (here NULL)

Arguments

delta

dist object or a symmetric, numeric data.frame or matrix of distances

r

power of the transformation of the fitted distances (corresponds to kappa/2 in power stress); defaults to 0.5 for standard stress

type

what type of MDS to fit. Currently one of "ratio", "interval", "mspline" or "ordinal". Default is "ratio".

ties

the handling of ties for ordinal (nonmetric) MDS. Possible are "primary" (default), "secondary" or "tertiary".

weightmat

a matrix of finite weights.

init

starting configuration

ndim

dimension of the configuration; defaults to 2

acc

numeric accuracy of the iteration. Default is 1e-6.

itmax

maximum number of iterations. Default is 10000.

verbose

should fitting information be printed; if > 0 then yes

principal

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

spline.degree

Degree of the spline for ‘mspline’ MDS type

spline.intKnots

Number of interior knots of the spline for ‘mspline’ MDS type

See Also

smacofSym

Examples

Run this code
dis<-smacof::kinshipdelta

## ordinal MDS
res<-rStressMin(as.matrix(dis), type = "ordinal", r = 1, itmax = 1000)
res
summary(res)
plot(res)

## spline MDS 
ress<-rStressMin(as.matrix(dis), type = "mspline", r = 1,
      itmax = 1000)
ress
plot(ress,"Shepard")

Run the code above in your browser using DataLab