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.
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.
check_Bmatrix(B, chvertices =NULL, verbose =TRUE)
Arguments
B: The kappas×n matrix such that Y ~ ABY or Frobenius norm ||Y-ABY|| is minimum
chvertices: The vector of rows which represent the Convex Hull of data frame
verbose: If set to TRUE, then results are printed out.
Returns
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)
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
#}