MDS: Multidimensional Scaling (MDS)

View source: R/MDS.R

MDSR Documentation

Multidimensional Scaling (MDS)

Description

Classical multidimensional scaling of a data matrix. Also known as principal coordinates analysis

Usage

MDS(DataOrDistances,method='euclidean',OutputDimension=2,PlotIt=FALSE,Cls)

Arguments

DataOrDistances

Numerical matrix defined as either

Data, i.e., [1:n,1:d], nonsymmetric, and consists of n cases of d-dimensional data points with every case having d attributes, variables or features,

or

Distances, i.e.,[1:n,1:n], symmetric and consists of n cases, e.g., as.matrix(dist(Data,method))

method

method specified by distance string: 'euclidean','cityblock=manhatten','cosine','chebychev','jaccard','minkowski','manhattan','binary'

OutputDimension

Number of dimensions in the Outputspace, default=2

PlotIt

Default: FALSE, If TRUE: Plots the projection as a 2d visualization.

Cls

[1:n,1] Optional,: only relevant if PlotIt=TRUE. Numeric vector, given Classification in numbers: every element is the cluster number of a certain corresponding element of data.

Details

An short overview of different types of projection methods can be found in [Thrun, 2018, p.42, Fig. 4.1] (\Sexpr[results=rd]{tools:::Rd_expr_doi("10.1007/978-3-658-20540-9")}).

Value

ProjectedPoints

[1:n,OutputDimension], n by OutputDimension matrix containing coordinates of the Projection

Eigenvalues

the eigenvalues of MDSvalues*MDSvalues'

Stress

Shephard-Kruskal Stress

Note

A wrapper for cmdscale

You can use the standard ShepardScatterPlot or the better approach through the ShepardDensityPlot of the CRAN package DataVisualizations.

Author(s)

Michael Thrun

Examples

data('Hepta')
Data=Hepta$Data

Proj=MDS(Data)

## Not run: 
PlotProjectedPoints(Proj$ProjectedPoints,Hepta$Cls)

## End(Not run)

ProjectionBasedClustering documentation built on Oct. 12, 2023, 1:07 a.m.