Skip to contents

Perturbation of two compositions.

Usage

powering(x, a, ...)

# S4 method for class 'numeric,numeric'
powering(x, a)

# S4 method for class 'CompositionMatrix,numeric'
powering(x, a)

Arguments

x

A numeric vector of compositional data or a CompositionMatrix object.

a

A numeric constant.

...

Currently not used.

Value

A numeric vector.

Details

In compositional geometry, powering replaces the product of a vector by a scalar (scaling) and is defined as the closed powering of the components by a given scalar.

See also

Other operations in the simplex: arithmetic, closure(), perturbation(), scalar()

Author

N. Frerebeau

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
#>           V1        V2   V3
#> S1 0.4166667 0.8333333 0.75

## 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.5  1 0.5

## Scalar product
scalar(x, y)
#> [1] 0.06646867