Skip to contents

Formula: x (+) y = C( x_1 y_1, ..., x_D y_D )

Usage

Perturb(x, y, total = 1)

Arguments

x, y

Strictly positive vectors of parts, the same length.

total

Constant the result sums to.

Value

List with composition, total, D.

References

Aitchison (1986), The Statistical Analysis of Compositional Data, Chapter 2. Verified against the reference implementation in the CRAN package compositions 2.0-9, whose perturbe is acomp(x * y) – the elementwise product, then closed.

Examples

V <- c(1, 2, 3, 4, 5, 6, 7, 8)
Perturb(V, V)
#> $composition
#> [1] 0.004901961 0.019607843 0.044117647 0.078431373 0.122549020 0.176470588
#> [7] 0.240196078 0.313725490
#> 
#> $total
#> [1] 1
#> 
#> $D
#> [1] 8
#> 
#> $method
#> [1] "Perturbation on the simplex"
#> 
#> attr(,"class")
#> [1] "morie_rich_result" "list"