MyNixOS website logo
Description

Fully Flexible Probabilities for Stress Testing and Portfolio Construction.

Implements numerical entropy-pooling for portfolio construction and scenario analysis as described in Meucci, Attilio (2008) and Meucci, Attilio (2010) <doi:10.2139/ssrn.1696802>.

Fully Flexible Probabilities

Lifecycle:experimental R-CMD-check Codecov testcoverage CRANstatus CRAN RStudio mirrordownloads CRAN RStudio mirrordownloads

Functions for Scenario Analysis and Risk Management

Oftentimes, the econometrician needs to stress-test the potential outcomes for a given set of risk-drivers. This process can be computationally costly when the entire set of scenarios needs to be repriced.

To overcome this difficulty, the Fully Flexible Probabilities (FFP) approach offers an inexpensive way for scenario generation: it reprices the probabilities associated to each scenario, instead of the scenarios themselves. Once the new probabilities have been defined, the computations can be performed very quickly because the burden of scenario generation has been left aside.

Installation

Install the official version from CRAN with:

install.packages("ffp")

Install the development version from github with:

# install.packages("devtools")
devtools::install_github("Reckziegel/ffp")

Probability Estimation

The package ffp comes with five functions to extract probabilities from the historical scenarios:

  • exp_decay(): accounts for the time-changing nature of volatility by giving more weight to recent observations;
  • crisp(): selects scenarios where a logical statement is satisfied;
  • kernel_normal(): generalizes the crisp condition by wrapping scenarios over a normal kernel;
  • kernel_entropy(): uses entropy-polling to satisfy a conditioning statement;
  • double_decay(): uses entropy-polling and a double-decay factor to constrain the first two moments of a distribution.

Stress-Testing and Portfolio Construction

The package also offers eight different constructors to make it easier to input views on the market for portfolio optimization (mean-variance, risk-parity, etc.):

  • view_on_mean()
  • view_on_covariance()
  • view_on_correlation()
  • view_on_volatility()
  • view_on_rank()
  • view_on_copula()
  • view_on_marginal_distribution()
  • view_on_joint_distribution()

The output is a list that entropy_pooling() can handle easily. To combine multiple views in a single object use bind_views().

Scenario Analysis

Once the new probabilities have been estimated, bootstrap_scenarios() can be used to sample data, while keeping the structure of the empirical copulas intact.

The main statistics of arbitrary scenarios can be computed with empirical_stats().

References

Metadata

Version

0.2.2

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