Skip to contents

Formula: totvar(x) = trace(Gamma) = (1/D) sum_{i<j} var{log(x_i/x_j)}

Usage

Comptotvar(X)

Arguments

X

See Usage.

Value

List with totvar, totvar_trace, clr_var, n, D.

References

Aitchison, A Concise Guide to Compositional Data Analysis, Chapter 2. Verified against the text: the centre estimate is xi-hat = C(g_1, ..., g_D) with g_i the geometric mean of the ith component, and totvar(x) = trace(Gamma) = (1/D) sum_{i<j} var{log(x_i/x_j)}.

Examples

V <- c(1, 2, 3, 4, 5, 6, 7, 8)
Comptotvar(V)
#> $totvar
#> [1] 0
#> 
#> $totvar_trace
#> [1] 0
#> 
#> $clr_var
#> [1] 0
#> 
#> $n
#> [1] 8
#> 
#> $D
#> [1] 1
#> 
#> $method
#> [1] "Compositional total variance"
#> 
#> attr(,"class")
#> [1] "morie_rich_result" "list"