Learn R Programming

Anthropometry (version 1.2)

stepArchetypoids: Run the archetypoid algorithm several times

Description

Execute the archetypoid algorithm repeatedly. It is inspired by the stepArchetypes function of the archetypes R package.

Usage

stepArchetypoids(numArchoid,nearest="cand_ns",data,ArchObj)

Arguments

numArchoid
Number of archetypoids.
nearest
Initial vector of archetypoids for the BUILD phase of the archetypoid algorithm. This initial vector contain the nearest individuals to the archetypes returned by the archetypes function of archetyp
data
Data matrix. Each row corresponds to an observation and each column corresponds to an anthropometric variable. All variables are numeric.
ArchObj
The list object returned by the stepArchetypesMod function. This function is a slight modification of the original stepArchetypes function o

Value

  • A list with the following elements:

    archet: Final vector of numArchoid archetypoids.

    rss: Residual sum of squares corresponding to the final vector of numArchoid archetypoids.

    archet_ini: Vector of initial archetypoids (cand_ns, cand_alpha or cand_beta).

    alphas: Alpha coefficients for the optimal vector of archetypoids.

References

Vinue, G., Epifanio, I., and Alemany, S., (2015). Archetypoids: a new approach to define representative archetypal data, Computational Statistics and Data Analysis 87, 102--115.

Cutler, A., and Breiman, L., (1994). Archetypal Analysis, Technometrics 36, 338--347.

Epifanio, I., Vinue, G., and Alemany, S., (2013). Archetypal analysis: contributions for estimating boundary cases in multivariate accommodation problem, Computers & Industrial Engineering 64, 757--765.

Eugster, M. J., and Leisch, F., (2009). From Spider-Man to Hero - Archetypal Analysis in R, Journal of Statistical Software 30, 1--23, http://www.jstatsoft.org/.

Eugster, M. J. A., (2012). Performance profiles based on archetypal athletes, International Journal of Performance Analysis in Sport 12, 166--187.

See Also

archetypoids, archetypes, stepArchetypes

Examples

Run this code
#COCKPIT DESIGN PROBLEM:
USAFSurvey_First50 <- USAFSurvey[1 : 50, ]
#Variable selection:
variabl_sel <- c(48, 40, 39, 33, 34, 36)
#Changing to inches: 
USAFSurvey_First50_inch <- USAFSurvey_First50[,variabl_sel] / (10 * 2.54)

#Data preprocessing:
USAFSurvey_preproc <- preprocessing(USAFSurvey_First50_inch, TRUE, 0.95, TRUE)

#For reproducing results, seed for randomness:
set.seed(2010) 
#Run archetype algorithm repeatedly from 1 to numArch archetypes:
numArch <- 10 ; numRep <- 20
lass <- stepArchetypesMod(data = USAFSurvey_preproc$data, 
                          numArch=1:numArch, numRep = numRep, 
                          verbose = FALSE)

#Run archetypoids algorithm repeatedly from 1 to numArch archetypes:
for(numArchoid in 1:numArch){
 temp <-  stepArchetypoids(numArchoid,nearest="cand_ns",USAFSurvey_preproc$data,lass)
 filename <- paste("res", numArchoid, sep="")
 assign(filename,temp)
 save(list=c(filename),file=paste(filename, ".RData", sep="")) 
}

Run the code above in your browser using DataLab