# check_Bmatrix: Function which checks B matrix of Archetypal Analysis Y ~ A B... In archetypal: Finds the Archetypal Analysis of a Data Frame

 check_Bmatrix 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 kappas \times 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.

### Value

A list with members:

1. used_rows, a list with used rows for creating each archetype

2. used_weights, a list with the relevant weights that have been used

3. leading_rows, the rows for each archetype with greatest weight

4. leading_weights, the weights of leading rows

5. used_on_convexhull, the portion of used rows which lie on Convex Hull (if given)

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
#

}


archetypal documentation built on May 29, 2024, 8:46 a.m.