PerformanceAnalytics

improved functionality for higher order comoment estimation

View package on GitHub

GSoC 2017 project by cdries

This project improves the functionality for estimation of higher-order comoments in the R packages PerformanceAnalytics and PortfolioAnalytics. First, the implementation of the estimators is optimized, resulting in a significant speed gain. This makes the methods usable in higher dimensions. Second, a full range of state-of-the-art higher order comoment estimators is added, previously unavailable for the community. This project page gives a summary of the work done during Google Summer of Code 2017.

The project is done under guidance of Brian Peterson, Kris Boudt and Peter Carl. Some of the newly available estimators are based on joint work with Kris Boudt (Vrije Universiteit Brussel) and Tim Verdonck (KU Leuven)

Installing the most current master branch of PerformanceAnalytics available on GitHub can be done as follows

require("devtools")
install_github("braverock/PerformanceAnalytics")

Part 1

The first major part of the project is can be found in this pull request. Here the functions M3.MM and M4.MM are written in C, exploiting the symmetric structure, leading to a dramatic speed improvement for moderate and larger dimensions.

Pull request 74 also improves the internal handling of the coskewness and cokurtosis matrices for the risk functions ES and VaR, making use of the optimized implementation of M3.MM and M4.MM. All helper functions in the PerformanceAnalytics package are now capable of accepting the reduced form coskewness and cokurtosis matrices containing only the unique elements and thus resulting in a memory gain.

In addition, structured (M2.struct, M3.struct, M4.struct), shrinkage (M2.shrink, M3.shrink, M4.shrink) and EWMA (M2.ewma, M3.ewma, M4.ewma) estimators are added. The structured estimators are based upon Simaan (1993), Martellini and Ziemann (2010) and Boudt, Lu and Peeters (2015). The shrinkage estimators implement Boudt, Cornilly and Verdonck (2017a) and the corrections to Martellini and Ziemann (2010) made in Boudt, Cornilly and Verdonck (2017a). The documentation of the added functions is written to accommodate these changes and a vignette is added explaining all the new comoment estimators. The vignette can also be downloaded here.

This part of the project is merged into the main branch of PerformanceAnalytics

Part 2

Next, Moment Component Analysis (MCA) for the coskewness and cokurtosis matrices, based on of Lim and Morton (2007) and Jondeau and Rockinger (2017) are implemented. MCA is a generalization of Principal Component Analysis to higher order moments. PCA tries to find component that explain variance in the data while MCA searches for components that explain skewness or heavy tails. The vignette is updated to include this technique and a pull request includes this estimator in the PerformanceAnalytics package.

For now, this part still has to be merged with the master branch, to load the code in order to use the M3.MCA and M4.MCA estimators, do:

require("githubinstall")
gh_install_packages("braverock/PerformanceAnalytics", ref = "MCA_rebase")

Part 3

Finally, the third stage of this project implements the Nearest Comoment Estimator. An estimator based on Boudt, Cornilly and Verdonck (2017b). This is still work in progress, and can be found in the NCE branch of PerformanceAnalytics.

To load this part of the project, execute the following code:

require("githubinstall")
gh_install_packages("braverock/PerformanceAnalytics", ref = "NCE_rebase")

Further work

The NCE estimator is still in research stage. Hence, its default settings might change. The NCE branch will be updated to contain the latest version of the estimator. When the estimator is finalized, the documentation will be extended and the estimator will also be added to the vignette, explaining the method in more depth.

The aim of this project was to improve the functionality of higher order comoment estimation within the PerformanceAnalytics package. This included numeical improvements, but also the implementation of new estimation methods. I will continue to update the package when new estimation proposals are made in the literature. This way, the package stays up to date.

References

Boudt, Kris, Cornilly, Dries and Verdonck, Tim. 2017a. A Coskewness shrinkage approach for estimating the skewness of linear combinations of random variables. Submitted. Available at SSRN: https://ssrn.com/abstract=2839781

Boudt, Kris, Cornilly, Dries and Verdonck, Tim. 2017b. Nearest Comoment Estimation. Available upon request from the authors.

Boudt, Kris, Lu, Wanbo and Peeters, Benedict. 2015. Higher order comoments of multifactor models and asset allocation. Finance Research Letters, 13, 225-233.

Lim, Hek-Leng and Morton, Jason. 2007. Principal cumulant component analysis. working paper

Jondeau, Eric and Jurczenko, Emmanuel. 2017. Moment component analysis: an illustration with international stock Markets. Journal of Business and Economic Statistics

Martellini, Lionel and Ziemann, Völker. 2010. Improved estimates of higher-order comoments and implications for portfolio selection. Review of Financial Studies, 23(4), 1467-1502.

Simaan, Yusif. 1993. Portfolio selection and asset pricing: three-parameter framework. Management Science, 39(5), 68-577