Learn R Programming

IndexConstruction (version 0.1-1)

IndexComp: Index derivation for price and liquidity indices

Description

IndexComp derives an Index from the given price and market capitalization or liquidity data. The number of constituents can be fixed or being chosen based on the methodology from Trimborn and Haerdle (2018).

Usage

IndexComp(market, price, vol = NULL, weighting = "market", weighting.all = "market", 
IC = "AIC", EvalSeq = c("Sequential", "AllTogether"), 
optimum = c("local", "global"), start.const = 1, steps = 1, fixed.value = NULL, 
base.value = 1000, derivation.period = 1, derivation.period.ic = 3, days.line)

Arguments

market

An xts object with the market capitalization data. The default is NULL, an entry is necessary if weighting is set to "market".

price

An xts object with the price data. An entry is always required.

vol

An xts object with the trading volume (liquidity) data. The default is NULL, an entry is necessary iw weighting is set to "volume".

weighting

The weighting scheme to be applied. "market" refers to weighting by market capitalization, "volume" refers to weighting by trading volume.

weighting.all

The weighting scheme to be applied to the full market index. "market" refers to weighting by market capitalization, "volume" refers to weighting by trading volume.

IC

Information Criterion to be used for the evaluation of the appropriate index to be used. Possible entries are "AIC", "GCV", "GFCV", "SH", "Cp" and "FPE".

EvalSeq

Indicates how the evaluation of the candidate indices by the IC shall be performed. "AllTogether" evaluates all indices against each other, "Sequential" evaluates always two consecutive indices against each other.

optimum

Define how to choose the optimal index. Either a "local" optimum is chosen, thus the derivation stops the first time the results become worse under the chosen IC, or a "global" optimum is chosen, thus all indices are derived and the best fitting one under the IC is chosen.

start.const

The number of constituents to start constructing the indices with. The default is 1.

steps

The step width for the number of constituents to construct the next index from. The default is 1.

fixed.value

In case no IC for the number of constituents for the index shall be applied, give the number of constituents the index shall contain. In that case, "IC", "EvalSeq", "optimum", "start.const" and "steps" are inactive parameters. The default is NULL.

base.value

The starting value for the index. The default is 1000.

derivation.period

The number of month after which the weights of the index are reallocated. The default is 1.

derivation.period.ic

The number of month after which the composition of the index is derived again, thus the number of constituents is reevaluated. The default is 3.

days.line

The days of the month to perform the recalculation on. Can be calculated from SwitchDates.

Value

A list, entry 1 is the optimal index, entry 2 the index of all constituents, entry 3 the index of all constituents rebased at the index (entry 1) each time after altering the number of index constituents which is useful for comparisons with the market, entry 4 the number of assets available for analysis in each period, entry 5 the absolute weight given to each assets price in the respective periods

Details

For more details, please see the methodology section of the paper Trimborn and Haerdle (2018).

References

Trimborn, S. and Haerdle, W.K. (2018). CRIX an Index for cryptocurrencies, Journal of Empirical Finance 49, pp. 107-122. https://doi.org/10.1016/j.jempfin.2018.08.004

Examples

Run this code
# NOT RUN {
data(CryptoData)

price = price["2014-03-31::2015-01-31"]
market = market["2014-03-31::2015-01-31"]
vol = vol["2014-03-31::2015-01-31"]
days.line = SwitchDates(price, specificDate = "1")

IndexComp(market = market, price = price, vol = vol, weighting = "market", 
weighting.all = "market", IC = "AIC", EvalSeq = "Sequential", optimum = "local", 
start.const = 5, steps = 5, days.line = days.line)
# }

Run the code above in your browser using DataLab