Package 'fmdu'

Title: (Restricted) [external] Multidimensional Unfolding
Description: Functions for performing (external) multidimensional unfolding. Restrictions (fixed coordinates or model restrictions) are available for both row and column coordinates in all combinations.
Authors: Frank Busing [aut, cre], Juan Claramunt Gonzalez [aut]
Maintainer: Frank Busing <[email protected]>
License: BSD_2_clause + file LICENSE
Version: 0.2.1
Built: 2025-02-14 05:58:19 UTC
Source: https://github.com/cran/fmdu

Help Index


Multidimensional External Unfolding Function

Description

external performs multidimensional external unfolding.

Usage

external(
  x,
  w = NULL,
  fixed = NULL,
  z = NULL,
  MAXITER = 1024,
  FCRIT = 1e-08,
  error.check = FALSE,
  echo = FALSE
)

Arguments

x

an n by m rectangular matrix containing dissimilarities or distances.

w

an identical sized matrix containing nonnegative weights (all ones when omitted).

fixed

fixed column coordinates (m x p).

z

null or initial row coordinates (n by p).

MAXITER

maximum number of iterations (default = 1024).

FCRIT

relative convergence criterion (default = 0.00000001).

error.check

extensive check validity input parameters (default = FALSE).

echo

print intermediate algorithm results (default = FALSE).

Value

x original n by m matrix with dissimilarities or distances.

w original n by m matrix with dissimilarity weights.

fixed original m x p fixed column coordinates.

z final n by p matrix with row coordinates.

d final n by m matrix with distances between rows of z and rows of fixed.

last.iteration final iteration number.

last.difference final function difference used for convergence testing.

mse final mean squared error function value.

rmse final root mean squared error function value.

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. (1987a). Joint ordination of species and sites: The unfolding technique. In P. Legendre and L. Legendre (Eds.), Developments in numerical ecology (pp. 189–221). Berlin, Heidelberg: Springer-Verlag.

Busing, F.M.T.A. (2010). Advances in multidimensional unfolding. Unpublished doctoral dissertation, Leiden University, Leiden, the Netherlands.

Examples

## Not run: 
library( smacof )
data( "breakfast" )
x <- as.matrix( breakfast )
n <- nrow( x )
m <- ncol( x )
d.col <- as.matrix( dist( t( x ) ) )
r <- smacofSym( d.col )
print( r$conf )
e <- external( x, fixed = r$conf )
print( e$z )

## End(Not run)

(Restricted) Multidimensional Unfolding Function

Description

fastmdu performs three types of multidimensional unfolding in different combination for row and column objects. The function follows algorithms given by de Leeuw and Heiser (1980), Heiser (1987), and Busing (2010).

Usage

fastmdu(
  delta,
  w = NULL,
  p = 2,
  x = NULL,
  rx = NULL,
  y = NULL,
  ry = NULL,
  ridge = 0,
  lasso = 0,
  group = 0,
  MAXITER = 1024,
  FCRIT = 1e-08,
  error.check = FALSE,
  echo = FALSE
)

Arguments

delta

an n by m rectangular matrix containing dissimilarities.

w

an identical sized matrix containing nonnegative weights (all ones when omitted).

p

dimensionality (default = 2).

x

either initial or fixed row coordinates (n by p) or independent row variables (n by hx).

rx

Row restriction. If omitted, x is free and x contains the initial row coordinates. If logical valued, x (n by p) contains the initial row coordinates and rx (n by p) indicates free (false) and fixed (true) row coordinates. If real valued, x (n by hx) contains hx independent row variables and rx (hx by p) contains the initial row regression coefficients.

y

either initial or fixed column coordinates (m by p) or independent column variables (n by hy).

ry

Column restriction. If omitted, y is free and y contains the initial column coordinates. If logical valued, y (m by p) contains the initial column coordinates and ry (m by p) indicated free (false) and fixed (true) column coordinates. If real valued, y (n by hy) contains hy independent column variables and ry (hy by p) contains the initial column regression coefficients.

ridge

penalty parameter for ridge penalty

lasso

penalty parameter for lasso penalty

group

penalty parameter for grouped lasso penalty

MAXITER

maximum number of iterations (default = 1024).

FCRIT

relative convergence criterion (default = 0.00000001).

error.check

extensive check validity input parameters (default = FALSE).

echo

print intermediate algorithm results (default = FALSE).

Value

data original n by m matrix with dissimilarities.

weights original n by m matrix with dissimilarity weights.

row.coordinates final n by p matrix with row coordinates.

col.coordinates final m by p matrix with column coordinates.

row.coefficients if rx is real valued, final hx by p matrix with row regression coefficients.

col.coefficients if ry is real valued, final hy by p matrix with column regression coefficients.

distances final n by m matrix with distances.

last.iteration final iteration number.

last.difference final function difference used for convergence testing.

n.stress final normalized stress value.

stress.1 final stress-1 value.

call function call

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. (1987a). Joint ordination of species and sites: The unfolding technique. In P. Legendre and L. Legendre (Eds.), Developments in numerical ecology (pp. 189–221). Berlin, Heidelberg: Springer-Verlag.

Busing, F.M.T.A. (2010). Advances in multidimensional unfolding. Unpublished doctoral dissertation, Leiden University, Leiden, the Netherlands.

Examples

## Not run: 
library( smacof )
data( "breakfast" )
breakfast <- as.matrix( breakfast )
n <- nrow( breakfast )
m <- ncol( breakfast )
p <- 2
w <- matrix( 1, n, m )
x <- matrix( runif( n * p ), n, p )
y <- matrix( runif( m * p ), m, p )
r <- fastmdu( breakfast, w, p, x, NULL, y, NULL )
print( r )

## End(Not run)

Visualisation of a fmdu objects

Description

Plot method for a fmdu object. The plot shows the result of fmdu.

Usage

## S3 method for class 'fmdu'
plot(x, ...)

Arguments

x

An fmdu object .

...

additional arguments to pass

Value

No return value, called for side effects (plot)


Print method for all fmdu objects

Description

Print the results of a fmdu object

Usage

## S3 method for class 'fmdu'
print(x, ...)

Arguments

x

object of class fmdu.

...

additional arguments to be passed.

Value

No return value, called for side effects (print)


Summary method for all fmdu objects

Description

Summary method for all fmdu objects

Usage

## S3 method for class 'fmdu'
summary(object, ...)

Arguments

object

object of class fmdu.

...

additional arguments to be passed.

Value

No return value, called for side effects (summary)


Ultra Fast Multidimensional Unfolding Function

Description

ultrafastmds performs simple (weighted) metric multidimensional unfolding. The function follows algorithms given de Leeuw (1977), Agrafiotis (2003), Rajawat and Kumar (2017), and Busing (submitted). The memory footprint is delta, x, and y, and w, fixed x and fixed y if present, all provided as input parameter.

Usage

ultrafastmdu(
  data,
  x,
  y,
  w = NULL,
  fx = NULL,
  fy = NULL,
  NSTEPS = 4096,
  RCRIT = 1e-08,
  seed = runif(1, 1, as.integer(.Machine$integer.max))
)

Arguments

data

an n by m dissimilarity matrix

x

an n by p (p < m) initial row coordinates matrix (required).

y

an m by p (p < m) initial column coordinates matrix (required).

w

(optional) an n by m weights matrix

fx

(optional) an n by p (p < m) fixed row coordinates indicator matrix (0=free;1=fixed) (optional).

fy

(optional) an m by p (p < m) fixed column coordinates indicator matrix (0=free;1=fixed) (optional).

NSTEPS

(optional) minimum number of learning rate steps (default = 4096).

RCRIT

(optional) relative convergence criterion, i.e., lowest learning rate (default = 0.00000001).

seed

(optional) seed passed to the C functions.

Value

x final n by p matrix with row coordinates.

y final m by p matrix with column coordinates.

References

de Leeuw (1977). Application of convex analysis to multidimensional scaling. Recent developments in statistics, pp. 133-145, North-Holland.

Agrafiotis, D.K. (2003). Stochastic Proximity Embedding. Journal of computational chemistry, volume 24, number 10, pages 1215-1221. Wiley Online Library.

Rajawat, K. and Kumar, S. (2017). Stochastic Multidimensional Scaling. IEEE Transactions on Signal and Information Processing over Networks, Vol. 3, No. 2, June 2017.

Busing (submitted). Node Localization by Multidimensional Scaling with Iterative Majorization: An Overview of a Comprehensive Algorithm.

Examples

## Not run: 
library(fmdu)

n <- 1000
m <- 10
data <- matrix( runif( n * m ), n, m )
p <- 2
x <- matrix( rnorm( n * p ), n, p )
y <- matrix( rnorm( m * p ), m, p )
r <- ultrafastmdu( data, x, y )

## End(Not run)