Skip to main content
. Author manuscript; available in PMC: 2011 Aug 14.
Published in final edited form as: Stat Sci. 2010 Aug 1;25(3):311–324. doi: 10.1214/10-STS336

Algorithm 3.

(MDS) Given weights W and distances Y ∈ ℝq×q, find the matrix Θ = [θ1, …, θq] ∈ ℝp×q which minimizes the stress (3.8).

Precompute: xijwij yij for all 1 ≤ i, jq
Precompute: wi· ← Σj wij for all 1 ≤ iq
Initialize: Draw θ0ki uniformly on [−1,1] for all 1 ≤ iq, 1 ≤ kp
repeat
 Compute ΘntΘn
dnij{ΘntΘn}ii+{ΘntΘn}jj2{ΘntΘn}ij for all 1 ≤ i, jq
znijxij/dnij for all 1 ≤ ijq
zni· ← Σj znij for all 1 ≤ iq
 Compute Θ;n(WZn)
θn+1,ki[θnki(wi·+zni·)+{Θn(WZn)}ik]/(2wi·) for all 1 ≤ ip, 1 ≤ kq
until convergence occurs