quickfechner.Rd
This function computes a fechnerian distance matrix from either a similarity matrix or a dissimilarity matrix. In addition to the basic procedure which looks for the shortest paths between the objects in the dissimilarity matrix a second approach is offered which connects similarities in a multiplicative manner.
quickfechner(x, x.type = "diss", scale ="-", path.op = "+", sym.op = "+", rescale = FALSE, exclude.zero = FALSE, check = TRUE)
x | A similarity or dissimilarity matrix. |
---|---|
x.type | The type of the matrix ( |
scale | Either divide the similarities by the diagonal entries
( |
path.op | Whether to use the similarities to find multiplicative paths ( |
sym.op | This sets the function which is used to ensure symmetry. |
rescale | Whether or not the original diagonal will be used for a correction of the results. |
exclude.zero | If |
check | Whether or not to check for regular minimality or maximality. |
The algorithm first computes a dissimilarity matrix with a zero-diagonal. Then it iteratively tries to find shorter paths between the items.
The Fechnerian distance matrix.
data(olives) #not a distance matrix, but a similarity matrix in some sense cx <- 1-abs(cor(olives[-c(1,2,11)])) cx2 <- quickfechner(cx) rownames(cx2) <- names(olives)[-c(1,2,11)] plot(hclust(as.dist(cx2)))dm <- matrix(runif(100),10,10) dm <- dm+t(dm) diag(dm) <- 0 dm2 <- quickfechner(dm) dmS <- 1-dm/max(dm) dmS2 <- quickfechner(dmS, x.type="sim", path.op = "*")# NOT RUN { # check triangular inequality: extracat:::trinq(dm) extracat:::trinq(dm2) extracat:::trinq(dmS2) # }