indexUpdate {IndexConstruction} | R Documentation |
Updating an existing index with new index values
Description
indexUpdate
derives the next values of an Index from the given price, weights and its divisor. This function is meant for continuous updating and display of an index on a website. For the derivation of an index for analysis purposes, please refer to the function "indexComp"
.
Usage
indexUpdate(price, index.weights, divisor)
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 |
divisor |
The divisor required for the index derivation. The divisor is provided by |
Details
For more details, please see the methodology section of the paper Trimborn and Haerdle (2018).
Value
The next value(s) of 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)
divisor = 17185084
indexUpdate(price["2017-02-01", const.names], index.weights = index.weights, divisor = divisor)