knitr::opts_chunk$set( collapse = TRUE, comment = "#>", fig.path = "man/figures/README-", out.width = "100%" )
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 objectsaddBLViews() and addCOPViews() allow more views to be added to existing objectsdistribution() and mvdistribution() create distribution and mvdistribution objects BLPosterior() calculates the posterior distribution using the Black-Litterman modelCOPPosterior() calculates the posterior distribution using copula opinion poolingYou 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")
library(BLCOP) # For a matrix of monthly returns for 6 assets head(monthlyReturns) # 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)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.