knitr::opts_chunk$set(
  collapse = TRUE,
  comment = "#>",
  fig.path = "man/figures/README-",
  out.width = "100%"
)

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.

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)

# 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)


MangoTheCat/BLCOP documentation built on Jan. 31, 2021, 12:20 p.m.