w.geoM: Weighted geometric mean

Description Usage Arguments Value Examples

Description

Weighted geometric mean

w.geoM computes the weighted geometric mean as defined in Egozcue and Pawlowsky (2016)

Weighted geometric mean

w.geoM computes the weighted geometric mean as defined in Egozcue and Pawlowsky (2016)

Usage

1
2
3
w.geoM(w, x)

w.geoM(w, x)

Arguments

w

vector of weights of the same length as x.

x

vector for which the weighted geometric mean is computed.

w

vector of weights of the same length as x.

x

vector for which the weighted geometric mean is computed.

Value

the weighted geometric mean value.

the weighted geometric mean value.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
# Build compositional vectors
  x <- prop.table(runif(10))
# Vector of weights
  w <- c(2,rep(1,9))

# Weighted geometric mean
  w.geoM(w,x)

# Build compositional vectors
  x <- prop.table(runif(10))
# Vector of weights
  w <- c(2,rep(1,9))

# Weighted geometric mean
  w.geoM(w,x)

UVic-omics/CoDA-wKMR documentation built on Oct. 31, 2019, 12:56 a.m.