relativeWeights {IndexConstruction} | R Documentation |
Retrieving the relative weights of the assets in the index
Description
relativeWeights
retrieves the relative weights of the assets in the index from the absolute weights expressed in shares of the assets. The latter is a direct output of indexComp
.
Usage
relativeWeights(price, index.weights)
Arguments
price |
An xts object with the price data. An entry is always required. |
index.weights |
A vector with the absolute weights expressed as number of shares of each asset. The weights are provided by |
Value
The relative weights of the assets in the Index.
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
data(CryptoData)
const.names = c("btc", "eth", "xrp", "ltc", "xmr")
index.weights = c(16136712, 88440036, 36856524148, 49589181, 13859864)
relativeWeights(price = price["2017-02-01", const.names], index.weights = index.weights)
[Package IndexConstruction version 0.1-3 Index]