
This function computes the dissimilarity defined in McCulloch et al. (1998), which is used in trimowa
and hipamAnthropom
. For more details, see also Ibanez et al. (2012) and Vinue et al. (2013).
getDistMatrix(data,np,nv,w,bl,bh,al,ah,verbose)
weightsMixtureUB
.
np
x np
matrix of dissimilarities.
bh
values are negative, all the bl
values are positive and all the al
and ah
slopes are positive (the sign of al
is changed within the function when computing the dissimilarities).
Ibanez, M. V., Vinue, G., Alemany, S., Simo, A., Epifanio, I., Domingo, J., and Ayala, G., (2012). Apparel sizing using trimmed PAM and OWA operators, Expert Systems with Applications 39, 10512--10520.
Vinue, G., Leon, T., Alemany, S., and Ayala, G., (2013). Looking for representative fit models for apparel sizing, Decision Support Systems 57, 22--33.
Leon, T., Zuccarello, P., Ayala, G., de Ves, E., and Domingo, J., (2007), Applying logistic regression to relevance feedback in image retrieval systems, Pattern Recognition 40, 2621--2632.
trimowa
, hipamAnthropom
#Data loading:
dataTrimowa <- sampleSpanishSurvey
bust <- dataTrimowa$bust
#First bust class:
data <- dataTrimowa[(bust >= 74) & (bust < 78), ]
numVar <- dim(dataTrimowa)[2]
#Weights calculation:
orness <- 0.7
weightsTrimowa <- weightsMixtureUB(orness,numVar)
#Constants required to specify the distance function:
numClust <- 3
bh <- (apply(as.matrix(log(data)),2,range)[2,]
- apply(as.matrix(log(data)),2,range)[1,]) / ((numClust-1) * 8)
bl <- -3 * bh
ah <- c(23,28,20,25,25)
al <- 3 * ah
#Data processing.
num.persons <- dim(data)[1]
num.variables <- dim(data)[2]
datam <- as.matrix(data)
datat <- aperm(datam, c(2,1))
dim(datat) <- c(1,num.persons * num.variables)
#Dissimilarity matrix:
D <- getDistMatrix(datat, num.persons, numVar, weightsTrimowa, bl, bh, al, ah, FALSE)
Run the code above in your browser using DataLab