Learn R Programming

RelValAnalysis (version 1.0)

fgp: Functionally Generated Portfolio Objects

Description

The function fgport is used to create functionally generated portfolio objects.

Usage

fgp(name, gen.function, weight.function)

Arguments

Value

namea character string, representing the name of the portfoliogen.funtiona function object, representating the generating functionweight.functiona function object, representing the weight function

Details

The function fgp is used to create functionally generated portfolio objects. Detailed treatments of functionally generated portfolios can be found in Chapter 3 of Fernholz (2002) as well as Pal and Wong (2014). In brief, a functionally generated portfolio is determined by a generating function (gen.function) and the weight function (weight.function). Some common functionally generated portfolios are provided in the package. For example, EntropyPortfolio is the entropy-weighted, DiversityPortfolio is a constructs fgp objects for the diversity-weigthed portfolio, and ConstantPortfolio defines constant-weighted portfolios. The most important operation concerning fgp objects is Fernholz's decomposition. See FernholzDecomp for more details.

References

Fernholz, E. R. (2002) Stochastic portfolio theory. Springer. Pal, S. and T.-K. L. Wong (2014). The geometry of relative arbitrage. arXiv preprint arXiv:1402.3720.

See Also

FernholzDecomp

Examples

Run this code
# Example 1: The diversity-weighted portfolio with p = 0.5
# This has the same effect has DiversityPortfolio(p = 0.5)
my.portfolio <- fgp("Diversity-Weighted Portfolio, p = 0.5",
                    function(x) (sum(sqrt(x)))^2,
                    function(x) sqrt(x) / sum(sqrt(x)))
                    
                    
# Example 2: A quadratic Gini coefficient
# See Example 3.4.7 of Fernholz (2002)

# Generating function
gen.function <- function(x) {
  n <- length(x)
  return(1 - sum((x - 1/n)^2)/2)
}

# Weight function
weight.function <- function(x) {
  n <- length(x)
  S <- gen.function(x) 
  return(((1/n - x)/S + 1 - sum(x*(1/n - x)/S))*x)
}

# Define fgp object
my.portfolio <- fgp("Quadratic Gini",
                    gen.function, weight.function)

# Its performance in the apple-starbucks market
data(applestarbucks)
market <- toymkt(applestarbucks)
result <- FernholzDecomp(market, my.portfolio, plot = TRUE)

Run the code above in your browser using DataLab