org.akutan.blacklitterman
Class BLResults

java.lang.Object
  extended by org.akutan.blacklitterman.BLResults
All Implemented Interfaces:
java.lang.Cloneable

public class BLResults
extends java.lang.Object
implements java.lang.Cloneable

This class holds results from a Black-Litterman mixing operation. It includes the asset names, list of views, estimated returns after views,

Since:
9 December 2007

Constructor Summary
BLResults(java.lang.String[] assets, BLViews views, cern.colt.matrix.DoubleMatrix1D er, cern.colt.matrix.DoubleMatrix2D V, cern.colt.matrix.DoubleMatrix1D baseWeights, cern.colt.matrix.DoubleMatrix1D unconstrainedWeights, cern.colt.matrix.DoubleMatrix1D viewWeights, double tau)
          Constructs
 
Method Summary
 cern.colt.matrix.DoubleMatrix1D getActiveWeights()
          Returns the active weights, results - base
 cern.colt.matrix.DoubleMatrix1D getBaseWeights()
          Returns the base weights (prior weights)
 cern.colt.matrix.DoubleMatrix1D getEr()
          Returns the posterior return vector
 double getPortfolioReturn()
          Returns the computed portfolio return from the unconstrained weights and the equilibrium returns.
 double getPortfolioReturn(cern.colt.matrix.DoubleMatrix1D w)
          Compute the portfolio return given a vector of weights
 double getTau()
           
 cern.colt.matrix.DoubleMatrix1D getUnconstrainedWeights()
          Returns the unconstrained weights
 cern.colt.matrix.DoubleMatrix2D getV()
          Returns the posterior covariance matrix
 BLViews getViews()
          Return the investors views
protected  java.lang.String rightJustify(java.lang.String input, int length)
          Helper function used to right justify text
 void setBaseWeights(cern.colt.matrix.DoubleMatrix1D baseWeights)
          Set the base weights
 void setDecFmt(java.text.DecimalFormat decFmt)
          Set the decimal format for output
 void setPctFmt(java.text.DecimalFormat pctFmt)
          Sets the percentage format for output
 void setRetFmt(java.text.DecimalFormat retFmt)
          Sets the return field format for output
 java.lang.String toString()
          Implementation of method to format BL results into a String
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

BLResults

public BLResults(java.lang.String[] assets,
                 BLViews views,
                 cern.colt.matrix.DoubleMatrix1D er,
                 cern.colt.matrix.DoubleMatrix2D V,
                 cern.colt.matrix.DoubleMatrix1D baseWeights,
                 cern.colt.matrix.DoubleMatrix1D unconstrainedWeights,
                 cern.colt.matrix.DoubleMatrix1D viewWeights,
                 double tau)
Constructs

Parameters:
assets - Array of asset class names
views - Container of the views
er - Vector of prior returns for each asset class
V - Covariance matrix of asset returns
baseWeights - Weights of the assets at equilibrium
unconstrainedWeights - Weights of the assets after applying the views
viewWeights - Weights of the views
tau - Uncertainty of the prior returns vs their means
Method Detail

getTau

public double getTau()
Returns:
the tau

getEr

public cern.colt.matrix.DoubleMatrix1D getEr()
Returns the posterior return vector

Returns:
Vector of posterior returns

getV

public cern.colt.matrix.DoubleMatrix2D getV()
Returns the posterior covariance matrix

Returns:
Covariance matrix

getViews

public BLViews getViews()
Return the investors views

Returns:
Investors views

getUnconstrainedWeights

public cern.colt.matrix.DoubleMatrix1D getUnconstrainedWeights()
Returns the unconstrained weights

Returns:
the unconstrained weights

getActiveWeights

public cern.colt.matrix.DoubleMatrix1D getActiveWeights()
Returns the active weights, results - base

Returns:
Vector of the active weights.

getPortfolioReturn

public double getPortfolioReturn()
Returns the computed portfolio return from the unconstrained weights and the equilibrium returns.

Returns:
the computed portfolio return

getPortfolioReturn

public double getPortfolioReturn(cern.colt.matrix.DoubleMatrix1D w)
Compute the portfolio return given a vector of weights

Parameters:
w - Weights to use in the calculation of return
Returns:
the computed portfolio return

getBaseWeights

public cern.colt.matrix.DoubleMatrix1D getBaseWeights()
Returns the base weights (prior weights)

Returns:
the base weights

setBaseWeights

public void setBaseWeights(cern.colt.matrix.DoubleMatrix1D baseWeights)
Set the base weights

Parameters:
baseWeights -

setDecFmt

public void setDecFmt(java.text.DecimalFormat decFmt)
Set the decimal format for output

Parameters:
decFmt -

setPctFmt

public void setPctFmt(java.text.DecimalFormat pctFmt)
Sets the percentage format for output

Parameters:
pctFmt -

setRetFmt

public void setRetFmt(java.text.DecimalFormat retFmt)
Sets the return field format for output

Parameters:
retFmt -

rightJustify

protected java.lang.String rightJustify(java.lang.String input,
                                        int length)
Helper function used to right justify text

Parameters:
input - String to be justified
length - to pad String out to
Returns:
Left padded string

toString

public java.lang.String toString()
Implementation of method to format BL results into a String

Overrides:
toString in class java.lang.Object
Returns:
Results formatted as a String
See Also:
Object.toString()