IndexConstruction is an R package for constructing and maintaining market indices from time-series data. The package implements an index construction methodology that allows the number of index constituents to adjust flexibly to the underlying market structure.
The methodology is particularly useful for markets in which the number and relative importance of assets change over time. In addition to the flexible index construction approach, the package provides functionality for constructing market-capitalization-weighted and volume-weighted indices with a fixed number of constituents.
The main function of the package is indexComp(), which performs the complete index construction and returns the resulting index for further analysis. The package also provides the functions indexMemberSelection(), indexMembersUpdate(), and indexUpdate(). These functions allow the individual steps of the index construction procedure to be carried out separately and can be used to continuously update an existing index.
The methodology implemented in this package was introduced in:
Trimborn, S. and Härdle, W. K. (2018). CRIX an Index for cryptocurrencies. Journal of Empirical Finance, 49, 107–122. doi:10.1016/j.jempfin.2018.08.004.
The package can be installed directly from GitHub. To do so, you first need the devtools package.
If devtools is not installed yet, run:
install.packages("devtools")
Then load devtools:
library(devtools)
You can now install the latest version of IndexConstruction from GitHub:
# install_github("SimonTrimborn/IndexConstruction")
install.packages("IndexConstruction", repos = c('https://simontrimborn.r-universe.dev', 'https://cloud.r-project.org'))
After installation, load the package with:
library(IndexConstruction)
The package is also available from CRAN and can be installed using:
install.packages("IndexConstruction")
The main function for constructing an index is:
indexComp(...)
It combines the different steps required for index construction, including the selection and updating of index constituents.
For applications in which the index needs to be updated continuously, the individual components can also be used separately:
indexMemberSelection(...)
indexMembersUpdate(...)
indexUpdate(...)
This makes the package suitable both for empirical analysis and for applications in which an index is regularly recalculated and published.
When using IndexConstruction in academic work, please cite:
Trimborn, S. and Härdle, W. K. (2018).
CRIX an Index for cryptocurrencies.
Journal of Empirical Finance, 49, 107–122.
doi:10.1016/j.jempfin.2018.08.004.