Perturbation of two compositions.
Usage
perturbation(x, y, ...)
# S4 method for numeric,numeric
perturbation(x, y)
# S4 method for CompositionMatrix,numeric
perturbation(x, y)
# S4 method for CompositionMatrix,matrix
perturbation(x, y)
Arguments
- x, y
A
numeric
vector of compositional data or aCompositionMatrix
object.- ...
Currently not used.
Value
A numeric
vector.
Details
In compositional geometry, perturbation plays the role of sum (translation). It is the closed component-wise product of two compositions.
See also
Other operations in the simplex:
arithmetic
,
closure()
,
powering()
,
scalar()
Examples
x <- as_composition(c(1, 2, 3))
y <- as_composition(c(1, 2, 1))
## Perturbation
perturbation(x, y)
#> <CompositionMatrix: 1 x 3>
#> V1 V2 V3
#> S1 0.125 0.5 0.375
x + y
#> <CompositionMatrix: 1 x 3>
#> V1 V2 V3
#> S1 0.125 0.5 0.375
## Powering
powering(y, 2)
#> <CompositionMatrix: 1 x 3>
#> V1 V2 V3
#> S1 0.1666667 0.6666667 0.1666667
y * 2
#> <CompositionMatrix: 1 x 3>
#> V1 V2 V3
#> S1 0.1666667 0.6666667 0.1666667
## Scalar product
scalar(x, y)
#> [1] 0.06646867