adalara {adamethods}R Documentation

Multivariate parallel archetypoid algorithm for large applications (ADALARA)


The ADALARA algorithm is based on the CLARA clustering algorithm. This is the parallel version of the algorithm to try to get faster results. It allows to detect anomalies (outliers). There are two different methods to detect them: the adjusted boxplot (default and most reliable option) and tolerance intervals. If needed, tolerance intervals allow to define a degree of outlierness.


adalara(data, N, m, numArchoid, numRep, huge, prob, type_alg = "ada", 
        compare = FALSE, vect_tol = c(0.95, 0.9, 0.85), alpha = 0.05, 
        outl_degree = c("outl_strong", "outl_semi_strong", "outl_moderate"), 
        method = "adjbox", frame)



Data matrix. Each row corresponds to an observation and each column corresponds to a variable. All variables are numeric. The data must have row names so that the algorithm can identify the archetypoids in every sample.


Number of samples.


Sample size of each sample.


Number of archetypes/archetypoids.


For each numArchoid, run the archetype algorithm numRep times.


Penalization added to solve the convex least squares problems.


Probability with values in [0,1].


String. Options are 'ada' for the non-robust adalara algorithm and 'ada_rob' for the robust adalara algorithm.


Boolean argument to compute the robust residual sum of squares if type_alg = "ada" and the non-robust if type_alg = "ada_rob".


Vector with the tolerance values. Default c(0.95, 0.9, 0.85). Needed if method='toler'.


Significance level. Default 0.05. Needed if method='toler'.


Type of outlier to identify the degree of outlierness. Default c("outl_strong", "outl_semi_strong", "outl_moderate"). Needed if method='toler'.


Method to compute the outliers. Options allowed are 'adjbox' for using adjusted boxplots for skewed distributions, and 'toler' for using tolerance intervals.


Boolean value to indicate whether the frame is computed (Mair et al., 2017) or not. The frame is made up of a subset of extreme points, so the archetypoids are only computed on the frame. Low frame densities are obtained when only small portions of the data were extreme. However, high frame densities reduce this speed-up.


A list with the following elements:


Guillermo Vinue, Irene Epifanio


Eugster, M.J.A. and Leisch, F., From Spider-Man to Hero - Archetypal Analysis in R, 2009. Journal of Statistical Software 30(8), 1-23,

Hubert, M. and Vandervieren, E., An adjusted boxplot for skewed distributions, 2008. Computational Statistics and Data Analysis 52(12), 5186-5201,

Kaufman, L. and Rousseeuw, P.J., Clustering Large Data Sets, 1986. Pattern Recognition in Practice, 425-437.

Mair, S., Boubekki, A. and Brefeld, U., Frame-based Data Factorizations, 2017. Proceedings of the 34th International Conference on Machine Learning, Sydney, Australia, 1-9.

Moliner, J. and Epifanio, I., Robust multivariate and functional archetypal analysis with application to financial time series analysis, 2019. Physica A: Statistical Mechanics and its Applications 519, 195-208.

Vinue, G., Anthropometry: An R Package for Analysis of Anthropometric Data, 2017. Journal of Statistical Software 77(6), 1-39,

See Also

do_ada, do_ada_robust, adalara_no_paral


## Not run: 

# Prepare parallelization (including the seed for reproducibility):
no_cores <- detectCores() - 1
cl <- makeCluster(no_cores)
clusterSetRNGStream(cl, iseed = 1)

# Load data:
data <- mtcars
n <- nrow(data)

# Arguments for the archetype/archetypoid algorithm:
# Number of archetypoids:
k <- 3 
numRep <- 2
huge <- 200

# Size of the random sample of observations:
m <- 10
# Number of samples:
N <- floor(1 + (n - m)/(m - k))
prob <- 0.75            

# ADALARA algorithm:
preproc <- preprocessing(data, stand = TRUE, percAccomm = 1)
data1 <-$data)

adalara_aux <- adalara(data1, N, m, k, numRep, huge, prob, 
                       "ada_rob", FALSE, method = "adjbox", frame = FALSE)

#adalara_aux <- adalara(data1, N, m, k, numRep, huge, prob, 
#                       "ada_rob", FALSE, vect_tol = c(0.95, 0.9, 0.85), alpha = 0.05, 
#                       outl_degree = c("outl_strong", "outl_semi_strong", "outl_moderate"),
#                       method = "toler", frame = FALSE)

# Take the minimum RSS, which is in the second position of every sublist:
adalara <- adalara_aux[which.min(unlist(sapply(adalara_aux, function(x) x[2])))][[1]]

# End parallelization:

## End(Not run)

[Package adamethods version 1.2.1 Index]