do_fada {adamethods} | R Documentation |
Run the whole functional archetypoid analysis with the Frobenius norm
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
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 |
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 |
PM |
Penalty matrix obtained with |
vect_tol |
Vector the tolerance values. Default c(0.95, 0.9, 0.85).
Needed if |
alpha |
Significance level. Default 0.05. Needed if |
outl_degree |
Type of outlier to identify the degree of outlierness.
Default c("outl_strong", "outl_semi_strong", "outl_moderate").
Needed if |
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 |
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_rob: If
compare_robust=TRUE
, this is the residual sum of squares using the robust Frobenius norm. Otherwise, NULL.resid: Vector of residuals.
outliers: Outliers.
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
## 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)