corybrunson / ordr

manage ordinations and render biplots in a tidyverse workflow
https://corybrunson.github.io/ordr/
GNU General Public License v3.0
22 stars 5 forks source link

measures of fit and their standard names #44

Open corybrunson opened 2 years ago

corybrunson commented 2 years ago

background

Gower &al (2011) detail several measures of fit for biplots, most prominently

These can be calculated directly from any SVD or EVD and interpreted for any technique based on them. In some cases they may also be calculated for supplementary elements.

suggestions

  1. A new .quality column, calculated as cumsum(.prop_var), could be added to the output of tidy.tbl_ord().
  2. The 1- or 2-dimensional adequacy and predictivity could be computed for all wrapped classes by augment_ord(), possibly via an option measures_of_fit = TRUE. (It would not be appropriate to annotate a tbl_ord with all $n \times k$ or $p \times k$ adequacies or predictivities.)
  3. Adequacy and predictivity for a specific value of $r$ could be computed in a mutate_*() call, e.g. mutate_rows(ord, fit_std = adequacy(dimension = 2L)), where adequacy() knows and is able to recover the necessary model components (cf. computing node and edge properties in tidygraph).

The value of (1) is, i think, self-evident. Probably only one of (2) and (3) would be appropriate, and i lean toward (3). Either would be valuable both (a) for downstream analysis of rows and columns and (b) as aesthetic mappings in biplots (e.g. to increase marker/vector opacity with predictivity/adequacy).

implementation

(2) and (3) would be supported by new recovery generics, possibly for the matrices of standard and of principal coordinates. (3) would probably require registration of the underlying model object within the wrapper, as in tidygraph.

corybrunson commented 2 years ago

Item (1) is done in fd71cafd526ab34d75722bc46d49c8e3058c4b99.