Learn R Programming

RelValAnalysis (version 1.0)

GeometricMean:

Geometric Mean

Description

The function GeometricMean computes the geometric mean of non-negative numbers with a given weight.

Usage

GeometricMean(x, weight = rep(1/length(x), length(x)))

Arguments

x

a numeric vector with non-negative entries.

weight
a numeric probability vector. The default value is the vector with equal weights.

Value

A number.

Details

The geometric mean is used in stochastic portfolio theory as the generating function of the constant-weighted portfolio. See Example 3.1.6 of Fernholz (2002).

References

Fernholz, E. R. (2002) Stochastic portfolio theory. Springer.

See Also

ConstantPortfolio

Examples

Run this code
x <- c(0.3, 0.7)
weight <- c(0.6, 0.4)
GeometricMean(x, weight)

Run the code above in your browser using DataLab