```{r equi_confplot, fig.align = "center", echo = FALSE} par(mfrow=c(1,2), pty = "s") plot(h2a$x, type = "n", col = "RED", xlab = "dim 1", ylab = "dim 2") text (h2a$x, as.character(1:10), col = "RED") plot(h2b$x, type = "n", col = "RED", xlab = "dim 1", ylab = "dim 2") text (h2b$x, as.character(1:10), col = "RED") ```

```{r equi_shepardplot, fig.align = "center", echo = FALSE} par(mfrow=c(1,2), pty = "s") plot(h2a$delta, h2a$dist, xlab = "dissimilarities", ylab = "distances", col = "RED", xlim = c(0, 1.5), ylim = c(0, 1.5)) abline (0, 1, col = "BLUE", lwd = 2) plot(h2b$delta, h2b$dist, xlab = "dissimilarities", ylab = "distances", col = "RED", xlim = c(0, 1.5), ylim = c(0, 1.5)) abline (0, 1, col = "BLUE", lwd = 2) ```

##Dutch Political Parties 1967 As the next illustration we use data from @degruijter_67, with average dissimilarity judgments between Dutch political parties in 1967. The data are ```{r poldist-data, echo = FALSE} poldist <- structure( c( 5.63, 5.27, 4.6, 4.8, 7.54, 6.73, 7.18, 6.17, 6.72, 5.64, 6.22, 5.12, 4.59, 7.22, 5.47, 5.46, 4.97, 8.13, 7.55, 6.9, 4.67, 3.2, 7.84, 6.73, 7.28, 6.13, 7.8, 7.08, 6.96, 6.04, 4.08, 6.34, 7.42, 6.88, 6.36, 7.36 ), Labels = c("KVP", "PvdA", "VVD", "ARP", "CHU", "CPN", "PSP", "BP", "D66"), Size = 9L, call = quote(as.dist.default(m = polpar)), class = "dist", Diag = FALSE, Upper = FALSE ) print (poldist) poldata <- as.vector (poldist) polnames <- attr (poldist, "Labels") ``` ```{r below_comp, echo = FALSE, cache = FALSE} h1a <- smacof (poldata) h1b <- smacofAbove (poldata, bnd = poldata) ``` The optimal `smacof` solution in two dimensions needs `r h1a$itel` iterations to arrive at stress `r h1a$stress`. Approximation from above, where we require that all distances are at least as large as the corresponding dissimilarties, uses `r h1b$itel` iterations and finds stress `r h1b$stress`. At the solution there are `r length (which (abs (h1b$constraints) < 1e-6))` active constraints, but as the Shepard plots in figure `r figure_nums (name = "gruijter_regular_shepard", display = "n")` show, the active constraints now do not correspond with the smallest dissimilarities, although they do correspond to the smallest distances.

```{r smacof_confplot, fig.align = "center", echo = FALSE} par(mfrow=c(1,2), pty = "s") plot(h1a$x, type = "n", xlab = "dim 1", ylab = "dim 2")#, xlim = c(-.15, .15), ylim = c(-.15, .15)) text(h1a$x, polnames, col = "RED") plot(h1b$x, type = "n", xlab = "dim 1", ylab = "dim 2")#, xlim = c(-.15, .15), ylim = c(-.15, .15)) text(h1b$x, polnames, col = "RED") ```

```{r smacof_shepardplot, fig.align = "center", echo = FALSE} par(mfrow=c(1,2), pty = "s") plot(h1a$delta, h1a$dist, xlab = "dissimilarities", ylab = "distances", col = "RED")# xlim = c(0, .25), ylim = c(0, .25)) abline (0, 1, col = "BLUE", lwd = 2) plot(h1b$delta, h1b$dist, xlab = "dissimilarities", ylab = "distances", col = "RED")# xlim = c(0, .25), ylim = c(0, .25)) abline (0, 1, col = "BLUE", lwd = 2) ```

In the next analysis we require that all distances are larger than or equal to `r min(poldata)`, the minimum dissimilarity. In order words, the smallest distances must be larger than or equal to the minimum dissimilarity. ```{r gruijter_maxbound_comp, echo = FALSE} h1c <- smacofAbove (poldata, bnd = rep(min(poldata), length (poldata))) ``` The optimal solution under these constraints in two dimensions needs `r h1c$itel` iterations to arrive at stress `r h1c$stress`.

```{r gruijter_maxbound_plot, fig.align = "center", echo = FALSE} par(mfrow=c(1,2), pty = "s") plot (h1c$x, type = "n", xlab = "dim 1", ylab = "dim 2") text(h1c$x, polnames, col = "RED") plot (h1c$delta, h1c$dist, xlab = "dissimilarities", ylab = "distances", col = "RED") abline (0, 1, col = "BLUE", lwd = 2) ```

And finally an analysis in which we require that distances between ARP, CHU, KVP (the Christian Democrat parties) are larger than 5, and the distances between PvdA, PSP, CPN (the leftist parties) are also larger than 5. This forces them apart (as it turns out on ) ```{r gruijter_infbound_comp, echo = FALSE} bnd <- rep (0, length (poldata)) bnd[c(3, 4, 22, 12, 13, 31)] <- 5 h1d <- smacofAbove (poldata, bnd = bnd, verbose = FALSE) ``` The optimal solution under these constraints in two dimensions needs `r h1d$itel` iterations to arrive at stress `r h1d$stress`. The six constrained distances are `r h1d$dist[c(3, 4, 22, 12, 13, 31)]`, so the Christian Democrats, for example, are on an equilateral triangle with side 5.

```{r gruijter_infbound_plot, fig.align = "center", echo = FALSE} par(mfrow=c(1,2), pty = "s") plot (h1d$x, type = "n", xlab = "dim 1", ylab = "dim 2", xlim = c(-5, 5), ylim = c(-5, 5)) text(h1d$x, polnames, col = "RED") plot (h1d$delta, h1d$dist, xlab = "dissimilarities", ylab = "distances", col = "RED") abline (0, 1, col = "BLUE", lwd = 2) abline (h = 5, col = "GREEN", lwd = 2) ```

#Discussion The obvious next step is to combine the algorithms of @deleeuw_E_17b and this paper to implement both upper and lower bounds on the distances. Of course for that case we have to be careful that a solution actually exists. Another next step is to see in how far these bounding algorithms are useful for both metric and non-metric unfolding. #Appendix: Code ##below.R ```{r file_auxilary, code = readLines("above.R")} ``` ##auxilary.R ```{r file_auxilary, code = readLines("auxilary.R")} ``` ##mdsUtils.R ```{r file_auxilary, code = readLines("mdsUtils.R")} ``` ##smacof.R ```{r file_auxilary, code = readLines("smacof.R")} ``` ##smacofBelow.R ```{r file_auxilary, code = readLines("smacofAbove.R")} ``` #References