comp_ssr {dmbc}R Documentation

Sum of squared residuals (SSR) from the observed distances and the given latent configuration.

Description

comp_ssr computes the sum of squared residuals (SSR) from the observed distances (diss) and the given latent coordinates (x).

Usage

comp_ssr(x, diss)

Arguments

x

Real matrix containing the latent configuration.

diss

Observed dissimilarities (provided as a distance matrix).

Value

A length-one numeric vector providing the SSR for its arguments.

Author(s)

Sergio Venturini sergio.venturini@unicatt.it

See Also

bmds for (one-way) Bayesian (metric) multidimensional scaling.

Examples

n <- 10000
nr <- 200
nc <- floor(n/nr)
x <- matrix(rnorm(1:n), nrow = nr, ncol = nc)
obsdiss <- dist(x)
ssr <- numeric(ncol(x))
for (i in 1:ncol(x)) {
  ssr[i] <- comp_ssr(x[, 1:i], obsdiss)
}
plot(ssr, xlab = "number of dimensions", ylab = "SSR", type = "b")

[Package dmbc version 1.0.2 Index]