MyNixOS website logo
Description

Black-Litterman and Copula Opinion Pooling Frameworks.

An implementation of the Black-Litterman Model and Attilio Meucci's copula opinion pooling framework as described in Meucci, Attilio (2005) <doi:10.2139/ssrn.848407>, Meucci, Attilio (2006) <doi:10.2139/ssrn.872577> and Meucci, Attilio (2008) <doi:10.2139/ssrn.1117574>.

BLCOP

R-CMD-check

The {BLCOP} package is an implementation of the Black-Litterman and copula opinion pooling frameworks. The Black-Litterman model was devised in 1992 by Fisher Black and Robert Litterman. Their goal was to create a systematic method of specifying and then incorporating analyst/portfolio manager views into the estimation of market parameters.

  • BLViews() and COPViews() construct views objects
  • addBLViews() and addCOPViews() allow more views to be added to existing objects
  • distribution() and mvdistribution() create distribution and mvdistribution objects
  • BLPosterior() calculates the posterior distribution using the Black-Litterman model
  • COPPosterior() calculates the posterior distribution using copula opinion pooling

Installation

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

install.packages("BLCOP")

And the development version from GitHub with:

# install.packages("devtools")
devtools::install_github("MangoTheCat/BLCOP")

Example

library(BLCOP)

# For a matrix of monthly returns for 6 assets
head(monthlyReturns)
#>                     IBM          MS        DELL             C          JPM          BAC
#> 1998-02-02  0.057620253  0.19578623  0.40667739  0.1224778047  0.157384084  0.143954576
#> 1998-03-02 -0.005457679  0.04383326 -0.51565628  0.0785547367  0.087215863  0.064817518
#> 1998-04-01  0.115529027  0.08233841  0.19188192  0.0198333333  0.027283511  0.041952290
#> 1998-05-01  0.014067489 -0.01027006  0.02055728  0.0009805524 -0.018908776 -0.006578947
#> 1998-06-01 -0.022893617  0.17050986  0.12619828 -0.0101224490 -0.444607915  0.015761589
#> 1998-07-01  0.154080655 -0.04717084  0.17002478  0.1091868712  0.001589404  0.039900900

# Define a pick matrix (a vector of confidences)
pickMatrix <- matrix(c(1/2, -1, 1/2, 0, 0, 0), 
                     nrow = 1, 
                     ncol = 6)

# Create a views object
views <- BLViews(P = pickMatrix,
                 q = 0.06, 
                 confidences = 100,
                 assetNames = colnames(monthlyReturns))

# Determine the posterior distribution of these assets
BLPosterior(monthlyReturns, views, tau = 1/2, marketIndex = sp500Returns)
#> Prior means:
#>          IBM           MS         DELL            C          JPM          BAC 
#>  0.002269870  0.005799591 -0.001161339  0.001718354 -0.009042287  0.005472691 
#> Posterior means:
#>          IBM           MS         DELL            C          JPM          BAC 
#>  0.009795730 -0.016744179  0.014453759 -0.004741680 -0.015465517  0.001505639 
#> Posterior covariance:
#>              IBM          MS        DELL           C        JPM         BAC
#> IBM  0.022113337 0.011762652 0.013388809 0.009418743 0.01189892 0.006017050
#> MS   0.011762652 0.033040555 0.018441735 0.014076656 0.01650328 0.009143918
#> DELL 0.013388809 0.018441735 0.048344919 0.008453909 0.01088555 0.005957519
#> C    0.009418743 0.014076656 0.008453909 0.017307957 0.01246270 0.007215142
#> JPM  0.011898924 0.016503281 0.010885549 0.012462701 0.03032755 0.012937189
#> BAC  0.006017050 0.009143918 0.005957519 0.007215142 0.01293719 0.011893184
Metadata

Version

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