Learn R Programming

extracat (version 1.6-3)

quickfechner: fechnerian scaling

Description

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.

Usage

quickfechner(x, x.type = "diss", scale ="-", path.op = "+", sym.op = "+", rescale = FALSE)

Arguments

x
A similarity or dissimilarity matrix.
x.type
The type of the matrix ('sim' or 'diss').
scale
Either divide the similarities by the diagonal entries ('div', '/','*','exp','expected','mult','multiplicative') or subtract the diagonal entries in the dissimilari
path.op
Whether to use the similarities to find multiplicative paths ('*','exp','expected','mult','multiplicative') or to use the dissimilarities and find additive paths ('+','add
sym.op
This sets the function which is used to ensure symmetry. "min" uses the minumum value, "+", "sum" or "mean" use the sum. "none", NA or FALSE stand for no operation
rescale
Whether or not the original diagonal will be used for a correction of the results.

Value

  • The Fechnerian distance matrix.

Details

The algorithm first computes a dissimilarity matrix with a zero-diagonal. Then it iteratively tries to find shorter paths between the items.

Examples

Run this code
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)))

Run the code above in your browser using DataLab