MyNixOS website logo
Description

Uncorrelated Bets via Minimum Torsion Algorithm.

Implements Minimum Torsion for portfolio diversification as described in Meucci, Attilio (2013) <doi:10.2139/ssrn.2276632>.

uncorbets

Lifecycle:experimental Codecov testcoverage R-CMD-check

The Euler theorem has found extensive applications in finance, particularly for decomposing homogeneous risk measures of degree one. However, a limitation of this approach is that it doesn’t adequately isolate the true sources of risk within an investment portfolio, thus creating a gap in risk analysis.

The Minimum Torsion Bets (MTB) method offers a compelling solution to this challenge. Leveraging spectral decomposition, MTB selectively identifies uncorrelated factors that are as close as possible to the original variables among all possible matrix rotations. This approach ensures a refined understanding of the underlying risk structure.

The results of the MTB method yield a diversification distribution with several noteworthy properties:

  • It is always positive, reflecting a constructive aspect of risk management;
  • The distribution sums to $1$, maintaining consistency with probabilistic principles;
  • It accurately captures the true sources of risk, enabling a more precise and targeted risk management strategy;
  • The distribution offers insightful interpretations, adding analytical value to the decision-making process.

In essence, the Effective Number of Minimum Torsion Bets (ENMTB) extends traditional risk measures by providing a nuanced view of risk diversification, making it a valuable tool for financial professionals seeking to optimize portfolio performance.

Example

library(uncorbets)

# prepare data
returns <- diff(log(EuStockMarkets))
covariance <- cov(returns)

# Minimum Torsion Matrix
torsion_mat <- torsion(covariance)

# Prior Allocation (equal weights, for example)
w <- rep(1 / ncol(returns), ncol(returns))

# Compute diversification distribution and the diversification level
effective_bets(b = w, sigma = covariance, t = torsion_mat)
#> $p
#>           [,1]
#> DAX  0.2673005
#> SMI  0.2404370
#> CAC  0.2776369
#> FTSE 0.2146256
#> 
#> $enb
#> [1] 3.980549

# maximize the effective number of bets (enb)
max_effective_bets(x0 = w, sigma = covariance, t = torsion_mat)
#> $weights
#> [1] 0.2227163 0.2603372 0.2114589 0.3054876
#> 
#> $enb
#> [1] 4
#> 
#> $counts
#>      nfval ngval
#> [1,]    47     9
#> 
#> $lambda_lb
#>      [,1]
#> DAX     0
#> SMI     0
#> CAC     0
#> FTSE    0
#> 
#> $lambda_ub
#>      [,1]
#> DAX     0
#> SMI     0
#> CAC     0
#> FTSE    0
#> 
#> $lambda_eq
#> [1] 1.162481e-06
#> 
#> $gradient
#>               [,1]
#> DAX   1.966953e-06
#> SMI  -4.768372e-06
#> CAC   8.940697e-06
#> FTSE -3.337860e-06
#> 
#> $hessian
#>             DAX        SMI        CAC       FTSE
#> DAX   5.3149468 -1.4603802 -1.4893686 -0.5169268
#> SMI  -1.4603802  5.2212615 -3.6528175 -0.9075766
#> CAC  -1.4893686 -3.6528175  6.3451210 -0.5218244
#> FTSE -0.5169268 -0.9075766 -0.5218244  7.6046588

Installation

Install the released version from CRAN with:

install.packages("uncorbets")

Install the development version of uncorbets from github with:

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

References

Metadata

Version

0.1.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