check_Bmatrix {archetypal} | R Documentation |
Function which checks B matrix of Archetypal Analysis Y ~ A B Y in order to find the used rows for creating each archetype and the relevant used weights.
Description
Function which checks B matrix of Archetypal Analysis Y ~ A B Y in order to find the used rows for creating each archetype and the relevant used weights.
Usage
check_Bmatrix(B, chvertices = NULL, verbose = TRUE)
Arguments
B |
The |
chvertices |
The vector of rows which represent the Convex Hull of data frame |
verbose |
If set to TRUE, then results are printed out. |
Value
A list with members:
used_rows, a list with used rows for creating each archetype
used_weights, a list with the relevant weights that have been used
leading_rows, the rows for each archetype with greatest weight
leading_weights, the weights of leading rows
used_on_convexhull, the portion of used rows which lie on Convex Hull (if given)
See Also
archetypal
, check_Bmatrix
, find_closer_points
& study_AAconvergence
Examples
{
# Load data "wd2"
data("wd2")
df = wd2
# Run AA:
aa = archetypal(df = df, kappas = 3, verbose = FALSE)
# Check B matrix:
B = aa$B
yy = check_Bmatrix(B, verbose = TRUE)
yy$used_rows
yy$used_weights
yy$leading_rows
yy$leading_weights
# Check if used rows lie on ConvexHull
ch = chull(df)
yy = check_Bmatrix(B, chvertices = ch, verbose = FALSE)
yy$used_on_convexhull
#
}