Re-distribute inertia between rows and columns in an ordination.
recover_conference(x)
# S3 method for default
recover_conference(x)
get_conference(x)
revert_conference(x)
confer_inertia(x, p)
A tbl_ord.
Numeric vector of length 1 or 2. If length 1, the proportion of the
inertia assigned to the cases, with the remainder 1 - p
assigned to the
variables. If length 2, the proportions of the inertia assigned to the
cases and to the variables, respectively.
recover_conference()
returns the (statically implemented)
distribution of inertia between the rows and the columns as stored in the
model. confer_inertia()
returns a tbl_ord with a specified distribution
of inertia but the wrapped model unchanged. get_conference()
returns the
distribution currently conferred.
The inertia of a singular value decomposition \(X=UDV'\) consists in the squares of the singular values (the diagonal elements of \(D\)), and represents the variance, likened to the physical inertia, in the directions of the orthogonal singular vectors (the columns of \(U\) or of \(V\)). Biplots superimpose the projections of the rows and the columns of \(X\) onto these coordinate vectors, scaled by some proportion of the total inertia: \(UD^p\) and \(VD^q\). A biplot is balanced if \(p+q=1\). Read Orlov (2013) for more on conferring inertia in PCA.
recover_conference()
, like the other recoverers, is an S3 method that is exported for convenience but not intended to
be used directly.
Note: In case the "inertia"
attribute is a rectangular matrix, one may
only be able to confer it entirely to the cases (p = 1
) or entirely to the
variables (p = 0
).
Orlov K (2013) Answer to "Algebra of LDA. Fisher discrimination power of a variable and Linear Discriminant Analysis". CrossValidated, accessed 2019-07-26. https://stats.stackexchange.com/a/83114/68743
Other generic recoverers:
augmentation
,
recoverers
,
supplementation
# illustrative ordination: correspendence analysis of hair & eye data
haireye_ca <- ordinate(
as.data.frame(rowSums(HairEyeColor, dims = 2L)),
cols = everything(), model = MASS::corresp
)
print(haireye_ca)
#> # A tbl_ord of class 'correspondence': (4 x 1) x (4 x 1)'
#> # 1 coordinate: Can1
#> #
#> # Rows (standard): [ 4 x 1 | 1 ]
#> Can1 | name
#> | <chr>
#> 1 -1.10 | 1 Black
#> 2 -0.324 | 2 Brown
#> 3 -0.283 | 3 Red
#> 4 1.83 | 4 Blond
#> #
#> # Columns (standard): [ 4 x 1 | 1 ]
#> Can1 | name
#> | <chr>
#> 1 -1.08 | 1 Brown
#> 2 1.20 | 2 Blue
#> 3 -0.465 | 3 Hazel
#> 4 0.354 | 4 Green
# check distribution of inertia
get_conference(haireye_ca)
#> [1] 0 0
# confer inertia to rows, then to columns
confer_inertia(haireye_ca, "rows")
#> # A tbl_ord of class 'correspondence': (4 x 1) x (4 x 1)'
#> # 1 coordinate: Can1
#> #
#> # Rows (principal): [ 4 x 1 | 1 ]
#> Can1 | name
#> | <chr>
#> 1 -0.505 | 1 Black
#> 2 -0.148 | 2 Brown
#> 3 -0.130 | 3 Red
#> 4 0.835 | 4 Blond
#> #
#> # Columns (standard): [ 4 x 1 | 1 ]
#> Can1 | name
#> | <chr>
#> 1 -1.08 | 1 Brown
#> 2 1.20 | 2 Blue
#> 3 -0.465 | 3 Hazel
#> 4 0.354 | 4 Green
confer_inertia(haireye_ca, "columns")
#> # A tbl_ord of class 'correspondence': (4 x 1) x (4 x 1)'
#> # 1 coordinate: Can1
#> #
#> # Rows (standard): [ 4 x 1 | 1 ]
#> Can1 | name
#> | <chr>
#> 1 -1.10 | 1 Black
#> 2 -0.324 | 2 Brown
#> 3 -0.283 | 3 Red
#> 4 1.83 | 4 Blond
#> #
#> # Columns (principal): [ 4 x 1 | 1 ]
#> Can1 | name
#> | <chr>
#> 1 -0.492 | 1 Brown
#> 2 0.547 | 2 Blue
#> 3 -0.213 | 3 Hazel
#> 4 0.162 | 4 Green
# confer inertia symmetrically
(haireye_ca <- confer_inertia(haireye_ca, "symmetric"))
#> # A tbl_ord of class 'correspondence': (4 x 1) x (4 x 1)'
#> # 1 coordinate: Can1
#> #
#> # Rows (symmetric): [ 4 x 1 | 1 ]
#> Can1 | name
#> | <chr>
#> 1 -0.746 | 1 Black
#> 2 -0.219 | 2 Brown
#> 3 -0.192 | 3 Red
#> 4 1.24 | 4 Blond
#> #
#> # Columns (symmetric): [ 4 x 1 | 1 ]
#> Can1 | name
#> | <chr>
#> 1 -0.728 | 1 Brown
#> 2 0.810 | 2 Blue
#> 3 -0.315 | 3 Hazel
#> 4 0.239 | 4 Green
# check redistributed inertia
get_conference(haireye_ca)
#> [1] 0.5 0.5
# restore default distribution of inertia
revert_conference(haireye_ca)
#> # A tbl_ord of class 'correspondence': (4 x 1) x (4 x 1)'
#> # 1 coordinate: Can1
#> #
#> # Rows (standard): [ 4 x 1 | 1 ]
#> Can1 | name
#> | <chr>
#> 1 -1.10 | 1 Black
#> 2 -0.324 | 2 Brown
#> 3 -0.283 | 3 Red
#> 4 1.83 | 4 Blond
#> #
#> # Columns (standard): [ 4 x 1 | 1 ]
#> Can1 | name
#> | <chr>
#> 1 -1.08 | 1 Brown
#> 2 1.20 | 2 Blue
#> 3 -0.465 | 3 Hazel
#> 4 0.354 | 4 Green