|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.akutan.optimization.EntropySolver
public class EntropySolver
This class encapsulates an example of solving for the optimal portfolio using the entropy measure.
| Field Summary | |
|---|---|
protected java.text.DecimalFormat |
df
|
| Constructor Summary | |
|---|---|
EntropySolver(cern.colt.matrix.DoubleMatrix1D e_r,
cern.colt.matrix.DoubleMatrix2D V_p)
Constructs |
|
| Method Summary | |
|---|---|
protected void |
addPoint(double ra,
cern.colt.matrix.DoubleMatrix1D x,
cern.colt.matrix.DoubleMatrix1D e_r,
cern.colt.matrix.DoubleMatrix2D V,
java.util.List<SolvedPoint> l)
|
protected cern.colt.matrix.DoubleMatrix1D |
computeCi(cern.colt.matrix.DoubleMatrix1D M,
cern.colt.matrix.DoubleMatrix2D V,
double mu)
Uses Merton method to compute lambda and gamma, and thence c |
static double |
computeLambda(double risk_premium,
double sigma_m)
Called to compute the risk aversion of the market portfolio. |
protected java.lang.String |
formatOutput(int ct,
double ra,
cern.colt.matrix.DoubleMatrix1D x,
cern.colt.matrix.DoubleMatrix1D e_r,
cern.colt.matrix.DoubleMatrix2D V)
|
protected java.lang.String[] |
getAssetNames()
|
protected static cern.colt.matrix.DoubleMatrix1D |
getMarketWeights()
Returns the market weights from the example shown in the Idzorek paper on Black-Litterman. |
protected static cern.colt.matrix.DoubleMatrix2D |
getTestV()
Returns the covariance matrix for the example shown in the Idzorek paper on Black-Litterman. |
static void |
main(java.lang.String[] args)
Test code to show how this class works. |
protected static cern.colt.matrix.DoubleMatrix1D |
reverseOptimize(double lambda,
double rf,
cern.colt.matrix.DoubleMatrix2D V,
cern.colt.matrix.DoubleMatrix1D w)
Computes market implied excess returns given the following parameters |
void |
setPriors(cern.colt.matrix.DoubleMatrix1D priors)
|
java.util.List<SolvedPoint> |
solve(java.util.List<Constraint> extraConstraints,
org.akutan.optimization.ProgressIndicator progress)
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected final java.text.DecimalFormat df
| Constructor Detail |
|---|
public EntropySolver(cern.colt.matrix.DoubleMatrix1D e_r,
cern.colt.matrix.DoubleMatrix2D V_p)
| Method Detail |
|---|
public void setPriors(cern.colt.matrix.DoubleMatrix1D priors)
public java.util.List<SolvedPoint> solve(java.util.List<Constraint> extraConstraints,
org.akutan.optimization.ProgressIndicator progress)
solve in interface Solver
protected void addPoint(double ra,
cern.colt.matrix.DoubleMatrix1D x,
cern.colt.matrix.DoubleMatrix1D e_r,
cern.colt.matrix.DoubleMatrix2D V,
java.util.List<SolvedPoint> l)
protected java.lang.String formatOutput(int ct,
double ra,
cern.colt.matrix.DoubleMatrix1D x,
cern.colt.matrix.DoubleMatrix1D e_r,
cern.colt.matrix.DoubleMatrix2D V)
protected static cern.colt.matrix.DoubleMatrix1D getMarketWeights()
protected static cern.colt.matrix.DoubleMatrix2D getTestV()
protected java.lang.String[] getAssetNames()
public static double computeLambda(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).
protected static cern.colt.matrix.DoubleMatrix1D reverseOptimize(double lambda,
double rf,
cern.colt.matrix.DoubleMatrix2D V,
cern.colt.matrix.DoubleMatrix1D w)
lambda - 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 computeCi(cern.colt.matrix.DoubleMatrix1D M,
cern.colt.matrix.DoubleMatrix2D V,
double mu)
M - Input matrix of returnsV - Input matrix of covariancemu - Input constrained portfolio return.
public static void main(java.lang.String[] args)
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||