Statistics & probability

Nonmetric multidimensional scaling calculator with stress and Shepard plot

Nonmetric multidimensional scaling takes a complete symmetric dissimilarity matrix and seeks a two-dimensional arrangement whose interpoint distances follow the ordering of those dissimilarities.

Your numbers

Calculated on your device. Your inputs aren’t sent to us.

Your result

Ready when you are

Enter your inputs and select Calculate.

Report an issue

Behind the numbers

How this calculation works

Nonmetric multidimensional scaling takes a complete symmetric dissimilarity matrix and seeks a two-dimensional arrangement whose interpoint distances follow the ordering of those dissimilarities. Object labels must use the same order in rows and columns. The entries need not have a common meaningful ratio scale, but increasing dissimilarity must consistently mean less similarity for the intended interpretation to hold.

THE FORMULAStress-1=√[Σ(i<j)(distanceᵢⱼ−disparityᵢⱼ)²/Σ(i<j)distanceᵢⱼ²], with disparities monotone in supplied dissimilarities and primary weak ties.

A worked example

The six-object default is realized exactly by line positions0,1,3,6,10,15, so its theoretical 2D stress is zero; a converged numerical fit should approach that benchmark.

Good to know

5–50 objects, full finite symmetric dissimilarity matrix, 2D embedding, weak-tie convention declared; monotone-regression stress majorization with 10 deterministic seeded starts, <=1000 iterations each. Report best local stress, convergence and starts; no global optimum claim, missing distances or automatic dimension choice.

Start with ranked dissimilarities

Nonmetric multidimensional scaling takes a complete symmetric dissimilarity matrix and seeks a two-dimensional arrangement whose interpoint distances follow the ordering of those dissimilarities. Object labels must use the same order in rows and columns. The entries need not have a common meaningful ratio scale, but increasing dissimilarity must consistently mean less similarity for the intended interpretation to hold.

Enter five through fifty objects with nonnegative finite dissimilarities and zero self-distances. Although the interface accepts five, a two-dimensional ordination with very few objects is easy to overfit and difficult to assess. More observations provide a more informative rank constraint system. Missing distances, automatic dimension selection, and a choice among multiple distance definitions are outside the page's scope.

Zero-stress geometry and its Shepard relationAn exact 2D realization123456Points lie on one line.Theoretical stress = 0Shepard relationInput dissimilarityDistance = disparity
Scroll across to see the full diagram.
Default distances can be reproduced exactly. Rotations and reflections preserve this fit.

Compare this with the Classical multidimensional scaling calculator from pairwise distances. Optimizes a monotone relation between dissimilarities and embedding distances rather than preserving the supplied metric via eigendecomposition. Existing source explicitly excludes nonmetric stress fitting.

Disparities make the fitting nonmetric

The calculation distinguishes supplied dissimilarities, fitted disparities, and distances in the current two-dimensional configuration. Monotone regression fits disparities that respect the dissimilarity order while approaching the configuration distances. Stress-1 is the square root of the sum of squared distance-minus-disparity residuals divided by the sum of squared configuration distances, using each unordered object pair once.

A low stress describes fidelity to the selected rank information, not proof of a unique meaningful map. Monotonic transformations can preserve the dissimilarity ordering and therefore the nonmetric target. Axes carry no intrinsic units or direction: translating, rotating, or reflecting a solution leaves its distances unchanged. A map's apparent north, east, or diagonal orientation should not receive a scientific interpretation by itself.

Declare the tie and optimization conventions

Under primary, or weak, treatment of ties, equal input dissimilarities may receive different disparities when their order within the tied block follows current configuration distances. Distinct dissimilarity levels still obey the required order. A secondary tie convention would force one disparity for the entire tied block and can yield a different optimum; it must not be substituted without changing the documented method.

The engine uses ten reproducible initial configurations and bounded monotone-regression stress optimization. It reports the best local result along with convergence information. Multiple starts reduce dependence on one initialization but do not prove a global optimum. An iteration limit is a computational status, not evidence that two-dimensional rank representation is impossible. Compare final stress across starts before interpreting a visually attractive layout.

An exactly embeddable default checks the machinery

The default matrix comes from positions 0, 1, 3, 6, 10, and 15 on a line. Placing each position on the horizontal axis of a two-dimensional plot reproduces all fifteen pairwise distances exactly. Taking disparities equal to those distances gives zero residual sum of squares and therefore theoretical stress zero. The input includes tied separations, making the declared tie convention visible.

A numerical search should approach that zero-stress benchmark within its stopping tolerance, although its coordinates can be rotated, translated, reflected, or rescaled by normalization. Comparing coordinates element by element would be the wrong validation. Compare the stress and pairwise relationship instead. For real data without an exact two-dimensional realization, no analogous zero target is promised and the best local stress may remain positive.

Use the Shepard display to inspect residuals

A Shepard plot places the input dissimilarity on one axis and the fitted distances or disparities on the other. The monotone disparity curve describes the rank constraint; vertical gaps between distances and fitted disparities contribute to stress. A small number of large gaps can reveal particular object pairs that the chosen two-dimensional arrangement cannot represent well.

The ordination beside that plot shows object geometry, not the monotone transformation itself. Nearby objects are interpreted through their fitted separation; blank space between clusters has no special categorical meaning. Labels identify objects rather than adding dimensions. The static worked drawing illustrates a known arrangement and its increasing disparity pattern, while the computed output should be inspected for the actual entered matrix.

Avoid reading a fit as a statistical test

Stress is an optimization objective, not a p-value for clusters or evidence of a causal structure. Rules assigning universal quality labels to a fixed stress cutoff ignore sample size, tie frequency, dimension, and dissimilarity structure. A compact map can be useful for exploration even when it leaves important residuals, provided those residuals and the fitting limitations are disclosed.

Constant or nearly uninformative dissimilarities, duplicated objects, and numerous ties require care. Numerical scaling and a nonzero configuration-distance denominator matter for stable computation. The tool neither invents distances for missing pairs nor chooses a higher dimension when two dimensions fit poorly. If starts disagree materially or the work cap is reached, retain that uncertainty instead of selecting one appealing picture and suppressing the alternatives.

Choose NMDS when ranks carry the information

Classical multidimensional scaling uses eigendecomposition to preserve a supplied metric through a Euclidean approximation. NMDS instead optimizes agreement with a monotone relationship and explicitly measures stress. Use the classical page when the magnitude of each separation is meaningful and an eigenvalue-based representation answers the question. Use this page when the order of dissimilarities is the central information you intend to preserve.

Report the original dissimilarity definition, number of objects, two-dimensional choice, weak-tie convention, stress normalization, seed, number of starts, iterations, and convergence status. Keep the input matrix available so another analyst can repeat the fit. When a map is used in a presentation, accompany it with stress and a Shepard assessment; the positions alone conceal how much rank information the display has lost.

A few questions, answered

Are the two NMDS axes measured in the input units?

No. Orientation and scale are fitting conventions; the meaningful information lies in fitted separations and rank agreement.

What does weak treatment of ties mean?

Equal dissimilarities may receive different fitted disparities, while disparities still respect ordering between distinct dissimilarity levels.

Does the best start prove global optimality?

No. Multiple starts provide several local fits, and the reported result is the best found within bounded work.

Why can classical MDS and NMDS differ?

Classical MDS preserves distance magnitudes through eigendecomposition. NMDS optimizes a monotone relation and stress.

Find your calculator

Start typing to explore the library.