org.akutan.blacklitterman
Class IdzorekBLExample

java.lang.Object
  extended by org.akutan.blacklitterman.BlackLitterman
      extended by org.akutan.blacklitterman.IdzorekBLExample

public class IdzorekBLExample
extends BlackLitterman

This class implements the method described in Idzorek (2005) of driving the variance of the views from the confidence level by linearl solution of the variance to match the expected change in weight of the unconstrained portfolio. This program will match Idzorek's numbers within a few basis points for all the tables in his paper.

Since:
4 April 2006

Field Summary
 
Fields inherited from class org.akutan.blacklitterman.BlackLitterman
modifyVariance
 
Constructor Summary
IdzorekBLExample()
          Constructs
 
Method Summary
 BLResults applyViews(java.lang.String[] assets, BLViews views, cern.colt.matrix.DoubleMatrix2D V, cern.colt.matrix.DoubleMatrix1D pi, double tau, double delta, cern.colt.matrix.DoubleMatrix1D equilWeights)
          Applies specified views to asset information to derive a new view of the asset allocation.
protected  void displayStatus(java.lang.String[] assets, cern.colt.matrix.DoubleMatrix1D blw, cern.colt.matrix.DoubleMatrix1D equilWeights, BLView view, cern.colt.matrix.DoubleMatrix1D blw100)
           
protected  void example(double tau)
          Runs the Idzorek sample data through the views in the paper in order to match Idzorek's results.
 java.lang.String[] getAssetNames()
           
 cern.colt.matrix.DoubleMatrix1D getMarketWeights()
          Returns the market weights from the example shown in the Idzorek paper on Black-Litterman.
 cern.colt.matrix.DoubleMatrix2D getTestV()
          Returns the covariance matrix for the example shown in the Idzorek paper on Black-Litterman.
protected  double lineSearch(java.lang.String[] assets, double delta, cern.colt.matrix.DoubleMatrix2D V, cern.colt.matrix.DoubleMatrix1D pi, double tau, BLViews views, cern.colt.matrix.DoubleMatrix1D ew)
          Uses a simple line search to find the minimum value of the convex function over the interval 0 < k < 1.00.
static void main(java.lang.String[] args)
          Test code to show this class matches the examples shown in the Idzorek paper on Black-Litterman.
protected  java.lang.String numFormat(double d)
          Helper function to format a decimal with 6 decimal places for output.
protected  java.lang.String pctFormat(double d)
          Helper function to format a decimal as a percent for output.
protected  void showPortfolios(java.lang.String portfolio, BLResults results)
           
 
Methods inherited from class org.akutan.blacklitterman.BlackLitterman
applyBL, applyBL, computeDelta, computeEr, computeImpliedWeights, computeInterval, computeKLIC, computeLambda, computeLambdaN, computePartialTevSensitities, computeTev, computeTevSensitities, computeV, getViewVariance, isModifyVariance, maxValue, mehalanobisDistance, overallProbability, reverseOptimize, sensitivities, setModifyVariance
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

IdzorekBLExample

public IdzorekBLExample()
Constructs

Method Detail

pctFormat

protected java.lang.String pctFormat(double d)
Helper function to format a decimal as a percent for output.

Parameters:
d - decimal value to be formatted
Returns:
d formatted as a % string

numFormat

protected java.lang.String numFormat(double d)
Helper function to format a decimal with 6 decimal places for output.

Parameters:
d - decimal value to be formatted
Returns:
d formatted as a decimal to 6 places

getMarketWeights

public cern.colt.matrix.DoubleMatrix1D getMarketWeights()
Returns the market weights from the example shown in the Idzorek paper on Black-Litterman.

Returns:
Vector of market weights for the assets.

getTestV

public cern.colt.matrix.DoubleMatrix2D getTestV()
Returns the covariance matrix for the example shown in the Idzorek paper on Black-Litterman.

Returns:
Covariance matrix for the assets

getAssetNames

public java.lang.String[] getAssetNames()

applyViews

public BLResults applyViews(java.lang.String[] assets,
                            BLViews views,
                            cern.colt.matrix.DoubleMatrix2D V,
                            cern.colt.matrix.DoubleMatrix1D pi,
                            double tau,
                            double delta,
                            cern.colt.matrix.DoubleMatrix1D equilWeights)
Applies specified views to asset information to derive a new view of the asset allocation. Uses confidence information when applying the views.

Parameters:
assets - Array of asset names
views - Views to be applied
V - Input covariance matrix
pi - Vector of equilibrium returns
tau - Uncertainty of equilibrium returns about their means
delta - Risk aversion
equilWeights - Equilibrium weights (used for computing differences)
Returns:
Results for returns, variance and weights given the equilibrium and the views specified.

lineSearch

protected double lineSearch(java.lang.String[] assets,
                            double delta,
                            cern.colt.matrix.DoubleMatrix2D V,
                            cern.colt.matrix.DoubleMatrix1D pi,
                            double tau,
                            BLViews views,
                            cern.colt.matrix.DoubleMatrix1D ew)
Uses a simple line search to find the minimum value of the convex function over the interval 0 < k < 1.00. This number is variance of the uncertainty in the view.

Parameters:
assets - Array of names of the assets (in order to match pi)
delta - Coefficient of risk aversion.
V - Covariance matrix
pi - Vector of returns
tau - scaling factor for the covariance of the return estimates
views - Structure of views
ew - Equilibrium weights
Returns:
Returns the uncertainty in the view that corresponds to the solution.

showPortfolios

protected void showPortfolios(java.lang.String portfolio,
                              BLResults results)

displayStatus

protected void displayStatus(java.lang.String[] assets,
                             cern.colt.matrix.DoubleMatrix1D blw,
                             cern.colt.matrix.DoubleMatrix1D equilWeights,
                             BLView view,
                             cern.colt.matrix.DoubleMatrix1D blw100)

example

protected void example(double tau)
Runs the Idzorek sample data through the views in the paper in order to match Idzorek's results.


main

public static void main(java.lang.String[] args)
Test code to show this class matches the examples shown in the Idzorek paper on Black-Litterman.