|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.akutan.blacklitterman.BlackLitterman
public class BlackLitterman
This class encapsulates the top level Black-Litterman functionality in terms of backing the risk aversion out of the market portfolio, and then on to calculating the expected return with views.
| Field Summary | |
|---|---|
protected boolean |
modifyVariance
Flag indicating if posterior variance should also be calculcated, this flag must be enabled to match He and Litterman, 1999. |
| Constructor Summary | |
|---|---|
BlackLitterman()
Constructs |
|
| Method Summary | |
|---|---|
BLResults |
applyBL(java.lang.String[] assets,
cern.colt.matrix.DoubleMatrix2D V,
cern.colt.matrix.DoubleMatrix1D pi,
BLViews views,
double tau,
double delta,
cern.colt.matrix.DoubleMatrix1D w)
Called to apply the Black-Litterman model to the inputs in order to derive a posterior view of the asset returns and covariances. |
BLResults |
applyBL(java.lang.String[] assets,
cern.colt.matrix.DoubleMatrix2D V,
cern.colt.matrix.DoubleMatrix1D pi,
BLViews views,
double tau,
double delta,
cern.colt.matrix.DoubleMatrix1D w,
cern.colt.matrix.DoubleMatrix1D refW)
Called to apply the Black-Litterman model to the inputs in order to derive a posterior view of the asset returns and covariances. |
double |
computeDelta(double risk_premium,
double sigma_m)
Called to compute the risk aversion of the market portfolio. |
protected cern.colt.matrix.DoubleMatrix1D |
computeEr(cern.colt.matrix.DoubleMatrix2D V,
cern.colt.matrix.DoubleMatrix1D pi,
BLViews views,
double tau)
Called to apply the Black-Litterman transform to the inputs to compute a new excess return vector assuming 100% certainty in the estimates. |
protected cern.colt.matrix.DoubleMatrix1D |
computeImpliedWeights(double delta,
cern.colt.matrix.DoubleMatrix2D V,
cern.colt.matrix.DoubleMatrix1D mu)
Given the risk aversion coefficient, the covariance matrix and the excess returns we can calculate the implied weights. |
double |
computeInterval(double confidence,
double width)
This function is called to compute the variance of a distribution given a confidence level and a width. |
double |
computeKLIC(BLResults results)
Computes the Kullback-Leibler information criteria as a measure of the distance between the prior and the posterior distributions. |
protected cern.colt.matrix.DoubleMatrix1D |
computeLambda(BLViews views,
double tau,
cern.colt.matrix.DoubleMatrix1D wEq,
cern.colt.matrix.DoubleMatrix1D wStar)
Computes the He-Litterman Lambda value when posterior variance varies |
protected cern.colt.matrix.DoubleMatrix1D |
computeLambdaN(BLViews views,
double tau,
double delta,
cern.colt.matrix.DoubleMatrix2D V,
cern.colt.matrix.DoubleMatrix1D pi)
Computes the He-Litterman Lambda value when posterior variance does not vary. |
cern.colt.matrix.DoubleMatrix2D |
computePartialTevSensitities(double delta,
BLResults results)
Computes the partial sensitivites of the tracking error |
double |
computeTev(BLResults results)
Computes the standard tracking error of the active weights. |
cern.colt.matrix.DoubleMatrix1D |
computeTevSensitities(double lambda,
BLResults results)
Computes the sensitivites of the tracking error from the Braga-Natale paper. |
protected cern.colt.matrix.DoubleMatrix2D |
computeV(cern.colt.matrix.DoubleMatrix2D V,
cern.colt.matrix.DoubleMatrix1D pi,
BLViews views,
double tau)
Computes the posterior variance using a robust formula which works for any value of the view variance. |
double |
getViewVariance(double confidence,
double width)
Given the confidence specified as a decimal (area under the cdf) and the total width of the region specified in units, the variance is returned in units squared. |
boolean |
isModifyVariance()
State of the modifyVariance flag |
protected double |
maxValue(cern.colt.matrix.DoubleMatrix2D m)
Little helper function that runs through the matrix and finds the maximum absolute value for any entry. |
double |
mehalanobisDistance(double tau,
cern.colt.matrix.DoubleMatrix2D V,
cern.colt.matrix.DoubleMatrix1D mu,
cern.colt.matrix.DoubleMatrix1D x)
Called to compute the Mehalanobis distance (multidimensional Z-score) for this return vector given the mean return and variance matrix. |
double |
overallProbability(double tau,
cern.colt.matrix.DoubleMatrix2D V,
cern.colt.matrix.DoubleMatrix1D mu,
cern.colt.matrix.DoubleMatrix1D x)
Called to compute a probability for the updated returns given that the mehalanobis distance will be distributed as a Chi squared with n degrees of freedom. |
cern.colt.matrix.DoubleMatrix1D |
reverseOptimize(double delta,
double rf,
cern.colt.matrix.DoubleMatrix2D V,
cern.colt.matrix.DoubleMatrix1D w)
Computes market implied excess returns given the following parameters |
cern.colt.matrix.DoubleMatrix1D |
sensitivities(BLViews views,
double tau,
cern.colt.matrix.DoubleMatrix2D V,
cern.colt.matrix.DoubleMatrix1D mu,
cern.colt.matrix.DoubleMatrix1D x)
Called to compute the sensitivities of the Mahalanobis Distance to the various views. |
void |
setModifyVariance(boolean modifyVariance)
Sets state of the modifyVariance flag |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected boolean modifyVariance
| Constructor Detail |
|---|
public BlackLitterman()
| Method Detail |
|---|
public boolean isModifyVariance()
public void setModifyVariance(boolean modifyVariance)
modifyVariance - New value for modifyVariance flagpublic double computeTev(BLResults results)
results - Container of Black-Litterman model results
public cern.colt.matrix.DoubleMatrix1D computeTevSensitities(double lambda,
BLResults results)
lambda - The risk aversion parameterresults - Container of Black-Litterman model results.
public double computeKLIC(BLResults results)
results - Container of Black-Litterman model results.
public cern.colt.matrix.DoubleMatrix2D computePartialTevSensitities(double delta,
BLResults results)
delta - Risk aversion coefficientresults - The BL results
public double computeInterval(double confidence,
double width)
confidence - Expressed in percentwidth - of return confidence internal Expressed in percent
public double mehalanobisDistance(double tau,
cern.colt.matrix.DoubleMatrix2D V,
cern.colt.matrix.DoubleMatrix1D mu,
cern.colt.matrix.DoubleMatrix1D x)
tau - Parameter of uncertainty of the prior estimates of the returnsV - Covariance matrix of the returnsmu - Vector of prior estimates of the returnsx - Vector of posterior estimates of the returns (to be measured).
public double overallProbability(double tau,
cern.colt.matrix.DoubleMatrix2D V,
cern.colt.matrix.DoubleMatrix1D mu,
cern.colt.matrix.DoubleMatrix1D x)
tau - Parameter of uncertainty of the prior estimates of the returnsV - Covariance matrix for the assetsmu - Vector of prior estimates of the returnsx - Vector of posterior estimates of the returns (to be measured).
public cern.colt.matrix.DoubleMatrix1D sensitivities(BLViews views,
double tau,
cern.colt.matrix.DoubleMatrix2D V,
cern.colt.matrix.DoubleMatrix1D mu,
cern.colt.matrix.DoubleMatrix1D x)
views - Container of the viewstau - Parameter of uncertainty of the prior estimates of the returnsV - Covariance matrix for the assetsmu - Vector of prior estimates of the returnsx - Vector of posterior estimates of the returns (to be measured).
public double getViewVariance(double confidence,
double width)
confidence - width -
public double computeDelta(double risk_premium,
double sigma_m)
risk_premium - Expected risk premium of market portfolio over the risk free rate
(percent).sigma_m - Standard deviation of the market portfolio (percent).
public cern.colt.matrix.DoubleMatrix1D reverseOptimize(double delta,
double rf,
cern.colt.matrix.DoubleMatrix2D V,
cern.colt.matrix.DoubleMatrix1D w)
delta - Market portfolio implied risk aversionrf - Long run risk free rateV - Long run covariance matrix for the individual assetsw - Current equilibrium weights of the assets in the market portfolio
protected cern.colt.matrix.DoubleMatrix1D computeImpliedWeights(double delta,
cern.colt.matrix.DoubleMatrix2D V,
cern.colt.matrix.DoubleMatrix1D mu)
delta - The risk aversion coefficientV - The matrix of asset return covariancesmu - The vector of mean expected asset returns
public BLResults applyBL(java.lang.String[] assets,
cern.colt.matrix.DoubleMatrix2D V,
cern.colt.matrix.DoubleMatrix1D pi,
BLViews views,
double tau,
double delta,
cern.colt.matrix.DoubleMatrix1D w)
assets - Array of asset namesV - Matrix of asset return covariancespi - Vector of expected asset mean returnsviews - Structure of investors viewstau - Confidence in the priordelta - Risk aversion coefficientw - Equilibrium asset weights
public BLResults applyBL(java.lang.String[] assets,
cern.colt.matrix.DoubleMatrix2D V,
cern.colt.matrix.DoubleMatrix1D pi,
BLViews views,
double tau,
double delta,
cern.colt.matrix.DoubleMatrix1D w,
cern.colt.matrix.DoubleMatrix1D refW)
assets - Array of asset namesV - Matrix of asset return covariancespi - Vector of expected asset mean returnsviews - Structure of investors viewstau - Confidence in the priordelta - Risk aversion coefficientw - Equilibrium asset weights
protected cern.colt.matrix.DoubleMatrix1D computeLambda(BLViews views,
double tau,
cern.colt.matrix.DoubleMatrix1D wEq,
cern.colt.matrix.DoubleMatrix1D wStar)
views - Structure of investors viewstau - Confidence in the prior/equilibrium returnswEq - Vector of equilibrium asset weightswStar - Vector of asset weights after views have been applied.
protected cern.colt.matrix.DoubleMatrix1D computeLambdaN(BLViews views,
double tau,
double delta,
cern.colt.matrix.DoubleMatrix2D V,
cern.colt.matrix.DoubleMatrix1D pi)
views - Structure of investors viewstau - Confidence in prior/equilibrium returnsdelta - Risk aversion coefficientV - Matrix of covariances of asset returnspi - Vector of expected mean asset returns
protected double maxValue(cern.colt.matrix.DoubleMatrix2D m)
m - Input matrix
protected cern.colt.matrix.DoubleMatrix2D computeV(cern.colt.matrix.DoubleMatrix2D V,
cern.colt.matrix.DoubleMatrix1D pi,
BLViews views,
double tau)
V - Covariance matrix of expected returnspi - Market equilibrium returnsviews - List of user viewstau - Confidence parameter for the prior covariance
protected cern.colt.matrix.DoubleMatrix1D computeEr(cern.colt.matrix.DoubleMatrix2D V,
cern.colt.matrix.DoubleMatrix1D pi,
BLViews views,
double tau)
V - Matrix of covariances of asset returnspi - Vector of asset mean expected returnsviews - Structure of investors viewstau - Confidence in the prior/equilibrium returns
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||