getDistMatrix: Dissimilarity matrix between individuals and prototypes

Description Usage Arguments Details Value Note Author(s) References See Also Examples

View source: R/getDistMatrix.R

Description

In the definition of a sizing system, a distance function allows us to represent mathematically the idea of garment fit and it is a key element to quantify the misfit between an individual and the prototype.

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. (2014).

Usage

1
getDistMatrix(data,np,nv,w,bl,bh,al,ah,verbose)

Arguments

data

Data vector.

np

Number of observations in the database.

nv

Number of variables in the database.

w

Weights for the OWA operator computed by means of weightsMixtureUB.

bl,bh,al,ah

Constants required to specify the distance function.

verbose

Boolean variable (TRUE or FALSE) to indicate whether to report information on progress.

Details

At the computational level, it is asummed that all the 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).

Value

A symmetric np x np matrix of dissimilarities.

Note

This function requires a C code called cast.c. In order to use getDistMatrix outside the package, the dynamic-link library is called by means of the sentence dyn.load("cast.so") (In Windows, it would be dyn.load("cast.dll")).

Author(s)

Juan Domingo

References

McCulloch, C., Paal, B., and Ashdown, S., (1998). An optimization approach to apparel sizing, Journal of the Operational Research Society 49, 492–499.

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., (2014). 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.

See Also

trimowa, hipamAnthropom

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#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)

Anthropometry documentation built on Dec. 11, 2021, 9:08 a.m.