do_fada: Run the whole functional archetypoid analysis with the...

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

View source: R/do_fada.R

Description

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

Usage

1
2
3
4
do_fada(subset, numArchoid, numRep, huge, compare = FALSE, PM,
              vect_tol = c(0.95, 0.9, 0.85), alpha = 0.05, 
              outl_degree = c("outl_strong", "outl_semi_strong", "outl_moderate"),
              method = "adjbox", prob)

Arguments

subset

Data to obtain archetypes. In fadalara 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.

compare

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

PM

Penalty matrix obtained with eval.penalty.

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.

prob

If compare=TRUE, probability with values in [0,1].

Value

A list with the following elements:

Author(s)

Guillermo Vinue, Irene Epifanio

References

Epifanio, I., Functional archetype and archetypoid analysis, 2016. Computational Statistics and Data Analysis 104, 24-34, https://doi.org/10.1016/j.csda.2016.06.007

See Also

stepArchetypesRawData_funct, archetypoids_funct

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
29
30
31
32
33
34
35
36
## Not run: 
library(fda)
?growth
str(growth)
hgtm <- t(growth$hgtm)

# Create basis:
basis_fd <- create.bspline.basis(c(1,ncol(hgtm)), 10)
PM <- eval.penalty(basis_fd)
# Make fd object:
temp_points <- 1:ncol(hgtm)
temp_fd <- Data2fd(argvals = temp_points, y = growth$hgtm, basisobj = basis_fd)
data_archs <- t(temp_fd$coefs)

suppressWarnings(RNGversion("3.5.0"))
set.seed(2018)
res_fada <- do_fada(subset = data_archs, numArchoid = 3, numRep = 5, huge = 200, 
                    compare = FALSE, PM = PM, method = "adjbox")
str(res_fada)      

suppressWarnings(RNGversion("3.5.0"))
set.seed(2018)
res_fada1 <- do_fada(subset = data_archs, numArchoid = 3, numRep = 5, huge = 200, 
                     compare = FALSE, PM = PM, 
                     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_fada1)                               

res_fada2 <- do_fada(subset = data_archs, numArchoid = 3, numRep = 5, huge = 200, 
                    compare = TRUE, PM = PM, method = "adjbox", prob = 0.8)
str(res_fada2)  


## End(Not run)
                                  

adamethods documentation built on Aug. 4, 2020, 5:08 p.m.