g.rowMeans: Weighted Geometric Means of Rows

Description Usage Arguments Value References See Also Examples

View source: R/weighted_ILR.R

Description

Calculates weighted geometric mean (see references). Note if p=rep(1, nrow(y)) (default) then this is just the geometric mean of rows.

Usage

1
g.rowMeans(y, p = rep(1, nrow(y)))

Arguments

y

shifted data matrix (e.g., output of shiftp)

p

weights (should not be closed)

Value

vector (weighted geometric mean of rows)

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

See Also

g.colMeans

Examples

1
2
3
4
5
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)
y <- shiftp(x, p)
philr:::g.rowMeans(y, p)

Example output

 [1] 0.3010108 0.3021754 0.2815642 0.2912226 0.3005560 0.3163703 0.3129729
 [8] 0.3038387 0.2850835 0.2632350

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