Skip to contents

parts is a vector of one-based part indices.

Usage

Subcomp(x, parts, total = 1)

Arguments

x

Strictly positive vector of parts.

parts

One-based indices of the parts retained (at least two).

total

Constant the subcomposition sums to.

Value

List with composition, parts, total, D_sub, D.

Details

Formula: sub(x; S) = C( x_i : i in S )

References

Aitchison (1986), The Statistical Analysis of Compositional Data, Chapter 2, where the subcomposition is defined as the closure of the selected subvector.

Examples

V <- c(1, 2, 3, 4, 5, 6, 7, 8)
Subcomp(V, V)
#> $composition
#> [1] 0.02777778 0.05555556 0.08333333 0.11111111 0.13888889 0.16666667 0.19444444
#> [8] 0.22222222
#> 
#> $parts
#> [1] 1 2 3 4 5 6 7 8
#> 
#> $total
#> [1] 1
#> 
#> $D_sub
#> [1] 8
#> 
#> $D
#> [1] 8
#> 
#> $method
#> [1] "Subcomposition"
#> 
#> attr(,"class")
#> [1] "morie_rich_result" "list"