shift: Shift data to origin given by p

Description Usage Arguments Value Author(s) References Examples

Description

Shift must be applied before transformation

Usage

1
2
3
shiftp(x, p)

shiftpInv(y, p)

Arguments

x

closed compositional data matrix (or vector)

p

weights (should not be closed)

y

the shifted composition output by shiftp

Value

shifted data matrix y (no closure is applied) rows are samples, columns are parts

Author(s)

Justin Silverman & J. J. Egozcue

References

J. J. Egozcue, V. Pawlowsky-Glahn (2016) Changing the Reference Measure in the Simplex and its Weighting Effects. Austrian Journal of Statistics 45(4):25-44

Examples

1
2
3
4
p <- seq(.1,1,by=.2)
c <- t(rmultinom(10,100,c(.1,.6,.2,.3,.2))) + 0.65   # add a small pseudocount
x <- miniclo(c)
shiftp(x, p)

Example output

           [,1]     [,2]      [,3]      [,4]      [,5]
 [1,] 0.9346247 1.409201 0.2837772 0.2580422 0.1791768
 [2,] 0.9346247 1.441485 0.3225182 0.2580422 0.1468927
 [3,] 1.1283293 1.215496 0.3612591 0.2995503 0.1468927
 [4,] 0.6440678 1.118644 0.2450363 0.3272224 0.2760291
 [5,] 0.1598063 1.247780 0.4581114 0.2718782 0.2114609
 [6,] 0.6440678 1.538337 0.2256659 0.2442062 0.2114609
 [7,] 0.3535109 1.506053 0.2837772 0.3133864 0.1684154
 [8,] 0.4503632 1.183212 0.3031477 0.3687305 0.2114609
 [9,] 0.7409201 1.376917 0.3031477 0.3272224 0.1468927
[10,] 0.8377724 1.376917 0.3225182 0.3272224 0.1253699

philr documentation built on Nov. 8, 2020, 5:38 p.m.