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 |
external
performs multidimensional external unfolding.
external( x, w = NULL, fixed = NULL, z = NULL, MAXITER = 1024, FCRIT = 1e-08, error.check = FALSE, echo = FALSE )
external( x, w = NULL, fixed = NULL, z = NULL, MAXITER = 1024, FCRIT = 1e-08, error.check = FALSE, echo = FALSE )
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). |
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.
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.
## 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)
## 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)
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).
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 )
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 )
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). |
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
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.
## 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)
## 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)
Plot method for a fmdu
object. The plot shows the result of fmdu
.
## S3 method for class 'fmdu' plot(x, ...)
## S3 method for class 'fmdu' plot(x, ...)
x |
An fmdu object . |
... |
additional arguments to pass |
No return value, called for side effects (plot)
Print the results of a fmdu object
## S3 method for class 'fmdu' print(x, ...)
## S3 method for class 'fmdu' print(x, ...)
x |
object of class |
... |
additional arguments to be passed. |
No return value, called for side effects (print)
Summary method for all fmdu objects
## S3 method for class 'fmdu' summary(object, ...)
## S3 method for class 'fmdu' summary(object, ...)
object |
object of class |
... |
additional arguments to be passed. |
No return value, called for side effects (summary)
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.
ultrafastmdu( data, x, y, w = NULL, fx = NULL, fy = NULL, NSTEPS = 4096, RCRIT = 1e-08, seed = runif(1, 1, as.integer(.Machine$integer.max)) )
ultrafastmdu( data, x, y, w = NULL, fx = NULL, fy = NULL, NSTEPS = 4096, RCRIT = 1e-08, seed = runif(1, 1, as.integer(.Machine$integer.max)) )
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. |
x final n by p matrix with row coordinates.
y final m by p matrix with column coordinates.
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.
## 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)
## 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)