Learn R Programming

adamethods (version 1.2.1)

do_ada_robust: Run the whole robust archetypoid analysis with the robust Frobenius norm

Description

This function executes the entire procedure involved in the robust archetypoid analysis. Firstly, the initial vector of archetypoids is obtained using the robust archetypal algorithm and finally, the optimal vector of robust archetypoids is returned.

Usage

do_ada_robust(subset, numArchoid, numRep, huge, prob, 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")

Arguments

subset

Data to obtain archetypes. In ADALARA this is a subset of the entire data frame.

numArchoid

Number of archetypes/archetypoids.

numRep

For each numArch, run the archetype algorithm numRep times.

huge

Penalization added to solve the convex least squares problems.

prob

Probability with values in [0,1].

compare

Boolean argument to compute the non-robust residual sum of squares to compare these results with the ones provided by do_ada.

vect_tol

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

alpha

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

outl_degree

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

method

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

Value

A list with the following elements:

  • cases: Final vector of archetypoids.

  • alphas: Alpha coefficients for the final vector of archetypoids.

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

  • rss_non_rob: If compare=TRUE, this is the residual sum of squares using the non-robust Frobenius norm. Otherwise, NULL.

  • resid Vector of residuals.

  • outliers: Outliers.

References

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. https://doi.org/10.1016/j.physa.2018.12.036

See Also

stepArchetypesRawData_robust, archetypoids_robust

Examples

Run this code
# NOT RUN {
library(Anthropometry)
data(mtcars)
#data <- as.matrix(mtcars)
data <- mtcars

k <- 3
numRep <- 2
huge <- 200

preproc <- preprocessing(data, stand = TRUE, percAccomm = 1)
suppressWarnings(RNGversion("3.5.0"))
set.seed(2018)
res_ada_rob <- do_ada_robust(preproc$data, k, numRep, huge, 0.8,
                             FALSE, method = "adjbox")
str(res_ada_rob)    

res_ada_rob1 <- do_ada_robust(preproc$data, k, numRep, huge, 0.8,
                             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")
str(res_ada_rob1)  
# }
# NOT RUN {
                 
# }

Run the code above in your browser using DataLab