public class MarketEquilibrium extends Object
MarketEquilibrium translates between the market portfolio weights and the equilibrium excess returns. The only things needed to do those translations are the covariance matrix and the (market) risk aversion factor - that's what you need to supply when you instantiate this class.
This class performs unconstrained optimisation. For each set of asset returns there is an optimal set of weights. It also performs reverse (unconstrained) optimisation producing the "optimal" expected returns given a set of weights.
The name MarketEquilibrium is actually a bit misleading. By altering the risk aversion factor this class can/will describe the weights/returns equilibrium for any investor.
calculateAssetReturns(BasicMatrix)
,
calculateAssetWeights(BasicMatrix)
Constructor and Description |
---|
MarketEquilibrium(BasicMatrix covarianceMatrix) |
MarketEquilibrium(BasicMatrix covarianceMatrix,
Number riskAversionFactor) |
MarketEquilibrium(String[] assetNamesOrKeys,
BasicMatrix covarianceMatrix) |
MarketEquilibrium(String[] assetNamesOrKeys,
BasicMatrix covarianceMatrix,
Number riskAversionFactor) |
Modifier and Type | Method and Description |
---|---|
BasicMatrix |
calculateAssetReturns(BasicMatrix assetWeights)
If the input vector of asset weights are the weights of the market portfolio, then the ouput is the
equilibrium excess returns.
|
BasicMatrix |
calculateAssetWeights(BasicMatrix assetReturns)
If the input vector of returns are the equilibrium excess returns then the output is the market
portfolio weights.
|
static Scalar<?> |
calculatePortfolioReturn(BasicMatrix assetWeights,
BasicMatrix assetReturns)
Calculates the portfolio return using the input asset weights and returns.
|
Scalar<?> |
calculatePortfolioVariance(BasicMatrix assetWeights)
Calculates the portfolio variance using the input instrument weights.
|
void |
calibrate(BasicMatrix assetWeights,
BasicMatrix assetReturns)
Will set the risk aversion factor to the best fit for an observed pair of market portfolio asset
weights and equilibrium/historical excess returns.
|
MarketEquilibrium |
clean()
Equivalent to copying, but additionally the covariance matrix will be cleaned of negative and very
small eigenvalues to make it positive definite.
|
MarketEquilibrium |
copy() |
String |
getAssetKey(int index) |
String[] |
getAssetKeys() |
BasicMatrix |
getCovariances() |
Scalar<?> |
getRiskAversion() |
void |
setRiskAversion(Number factor) |
int |
size() |
BasicMatrix |
toCorrelations() |
public MarketEquilibrium(BasicMatrix covarianceMatrix)
public MarketEquilibrium(BasicMatrix covarianceMatrix, Number riskAversionFactor)
public MarketEquilibrium(String[] assetNamesOrKeys, BasicMatrix covarianceMatrix)
public MarketEquilibrium(String[] assetNamesOrKeys, BasicMatrix covarianceMatrix, Number riskAversionFactor)
public static Scalar<?> calculatePortfolioReturn(BasicMatrix assetWeights, BasicMatrix assetReturns)
public BasicMatrix calculateAssetReturns(BasicMatrix assetWeights)
public BasicMatrix calculateAssetWeights(BasicMatrix assetReturns)
public Scalar<?> calculatePortfolioVariance(BasicMatrix assetWeights)
public void calibrate(BasicMatrix assetWeights, BasicMatrix assetReturns)
public MarketEquilibrium clean()
public MarketEquilibrium copy()
public String getAssetKey(int index)
public String[] getAssetKeys()
public BasicMatrix getCovariances()
public Scalar<?> getRiskAversion()
public void setRiskAversion(Number factor)
public int size()
public BasicMatrix toCorrelations()
Copyright © 2017 Optimatika. All rights reserved.