MyNixOS website logo
Description

Vine Based (Un)Conditional Portfolio Risk Measure Estimation.

Following Sommer (2022) <https://mediatum.ub.tum.de/1658240> portfolio level risk estimates (e.g. Value at Risk, Expected Shortfall) are estimated by modeling each asset univariately by an ARMA-GARCH model and then their cross dependence via a Vine Copula model in a rolling window fashion. One can even condition on variables/time series at certain quantile levels to stress test the risk measure estimates.

portvine

Codecov testcoverage R-CMD-check lifecycle

Portfolio level unconditional as well as conditional risk measure estimation for backtesting and stress testing using Vine Copula and ARMA-GARCH models. The package implements the proposed approaches in Sommer (2022) and Sommer et al. (2023).

Installation

You can install the released version of portvine from CRAN with:

install.packages("portvine")

You can install the development version of portvine from GitHub with:

# install.packages("devtools")
devtools::install_github("EmanuelSommer/portvine")

What it does and why

The implemented algorithms for the unconditional as well as conditional portfolio level risk measure estimation are based on my masters thesis at the chair of Mathematical Statistics at the TUM which you can find here. The general idea of the unconditional risk measure estimation approach is summarized in the flowchart below for a $d$-dimensional portfolio.




For the single conditional approach the general idea for a $d$-dimensional portfolio and a market index $I$ is summarized in the flowchart below.




If you want to get your hands dirty fast the Get Started vignette is a perfect fit for you as it showcases a minimal case study with a lot of code examples and some handy visualization functions that were not incorporated into the package as they are highly opinionated.

In order to grasp what is going on under the hood a look at the Under the hood article on the package website is advised before starting to use the package. There the most important algorithms used during the risk measure estimation are explained. If this doesn’t saturate your hunger for the theory behind the package you should take a look at Sommer (2022).

Moreover the help pages are quite detailed so feel free to have a look at them.

Parallel processing

The risk estimation algorithms implemented in this package lend themselves perfectly for parallel processing. In this package this is enabled through the in my humble opinion amazing future framework. For details please have a look at the detailed section on parallel processing within the help page of the estimate_risk_roll() function (or function reference on the package website). Some performance measurements of different parallel strategies and further information on the implemented parallelisms are presented in the Parallel processing article on the package website.

Acknowledgements

This package is built on the shoulder of giants most importantly the R packages rvinecopulib and rugarch. Thus a big thanks goes to all the contributors and maintainers! Also I would like to thank Claudia Czado and Karoline Bax for giving me the opportunity to work on this project in the first place and their dedicated collaboration along the way!

Metadata

Version

1.0.3

License

Unknown

Platforms (75)

    Darwin
    FreeBSD
    Genode
    GHCJS
    Linux
    MMIXware
    NetBSD
    none
    OpenBSD
    Redox
    Solaris
    WASI
    Windows
Show all
  • aarch64-darwin
  • aarch64-genode
  • aarch64-linux
  • aarch64-netbsd
  • aarch64-none
  • aarch64_be-none
  • arm-none
  • armv5tel-linux
  • armv6l-linux
  • armv6l-netbsd
  • armv6l-none
  • armv7a-darwin
  • armv7a-linux
  • armv7a-netbsd
  • armv7l-linux
  • armv7l-netbsd
  • avr-none
  • i686-cygwin
  • i686-darwin
  • i686-freebsd
  • i686-genode
  • i686-linux
  • i686-netbsd
  • i686-none
  • i686-openbsd
  • i686-windows
  • javascript-ghcjs
  • loongarch64-linux
  • m68k-linux
  • m68k-netbsd
  • m68k-none
  • microblaze-linux
  • microblaze-none
  • microblazeel-linux
  • microblazeel-none
  • mips-linux
  • mips-none
  • mips64-linux
  • mips64-none
  • mips64el-linux
  • mipsel-linux
  • mipsel-netbsd
  • mmix-mmixware
  • msp430-none
  • or1k-none
  • powerpc-netbsd
  • powerpc-none
  • powerpc64-linux
  • powerpc64le-linux
  • powerpcle-none
  • riscv32-linux
  • riscv32-netbsd
  • riscv32-none
  • riscv64-linux
  • riscv64-netbsd
  • riscv64-none
  • rx-none
  • s390-linux
  • s390-none
  • s390x-linux
  • s390x-none
  • vc4-none
  • wasm32-wasi
  • wasm64-wasi
  • x86_64-cygwin
  • x86_64-darwin
  • x86_64-freebsd
  • x86_64-genode
  • x86_64-linux
  • x86_64-netbsd
  • x86_64-none
  • x86_64-openbsd
  • x86_64-redox
  • x86_64-solaris
  • x86_64-windows