EnergyEntropyDecomp: Energy-entropy Decomposition

Description Usage Arguments Details Value References See Also Examples

Description

The function EnergyEntropyDecomp computes and plots the energy-energy decomposition of any portfolio relative to the benchmark portfolio.

Usage

1
EnergyEntropyDecomp(market, weight, grouping = NULL, plot = TRUE)

Arguments

market

an object of class toymkt.

weight

a matrix or dataframe of portfolio weights. Each row represents a vector of portfolio weights.

grouping

a numeric vector of positive integers taking values from 1 to m, where m is the number of groups. An example is c(1, 1, 2, 3, 2, 3, 1), where m is 3. If grouping is given, the hierachical energy-entropy decomposition will be performed.

plot

TRUE or FALSE. If TRUE, the energy-entropy decomposition will be plotted. The default value is TRUE.

Details

The energy-entropy decomposition decomposes the excess log return of a portfolio (with respect to the benchmark) into three terms: free energy, control and change in relative entropy. See Section 2 of Pal and Wong (2013) for details. It is important to note that Pal and Wong (2013) assumes that the benchmark is a buy-and-hold portfolio, so that market$buy.and.hold is TRUE. The decomposition is modified so that an identity holds even when the market is not buy-and-hold. However in that case the control term in the decomposition is harder to interpret.

A portfolio can sometimes be thought of as a portfolio of portfolios, and the energy-entropy decomposition has a corresponding hierchical decomposition, see Section 3 of Pal and Wong (2013). If grouping is provided, the hierachical decomposition will be performed and plotted. An example of grouping is a label for sectors (say 1: financial, 2: utility, 3:energy, etc). For more details see the supplementary files available on the author's website.

Value

If grouping is not provided, it is a zoo object with the followign columns. The definitions of the terms can be found in Section 2 of Pal and Wong (2013). Each term represents an increment for the period.

Excess log return

relative log return.

Free energy

free energy.

Relative entropy

minus of the change of relative entropy.

Control

control.

Drift

drift. It equals free energy + control.

If grouping is provided, it is a list containing several zoo objects:

dlogV

relative log return.

free.energies

free energy and its decomposition.

relative.entropies

relative entropy and its decomposition.

control

control and its decomposition.

References

Pal, S. and T.-K. L. Wong (2013). Energy, entropy, and arbitrage. arXiv preprint arXiv:1308.5376.

Author's website: http://www.math.washington.edu/~wongting/

See Also

FreeEnergy, RelativeEntropy, EEControl,

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
# Example 1
# Energy-entropy decomposition for the entropy-weighted portfolio
data(applestarbucks)
market <- toymkt(applestarbucks, initial.weight = c(0.5, 0.5))
weight <- GetWeight(market, EntropyPortfolio$weight.function)
decomp <- EnergyEntropyDecomp(market, weight, plot = TRUE)


# Example 2
# Example of a hierchical decomposition of the entropy-weighted
# portfolio in the Atlas market model
model <- AtlasModel(n = 6, g = 0.1, sigma = 0.2)
market <- SimMarketModel(model)  # default settings
grouping <- c(1, 1, 2, 2, 2, 2)
weight <- GetWeight(market, EntropyPortfolio$weight.function)
decomp <- EnergyEntropyDecomp(market, weight, grouping, plot = TRUE)

Example output

Loading required package: zoo

Attaching package: 'zoo'

The following objects are masked from 'package:base':

    as.Date, as.Date.numeric

RelValAnalysis documentation built on May 2, 2019, 3:09 a.m.