Class MarkowitzByCLM
- java.lang.Object
-
- tech.nmfin.portfoliooptimization.markowitz.MarkowitzByQP
-
- tech.nmfin.portfoliooptimization.markowitz.MarkowitzByCLM
-
public class MarkowitzByCLM extends MarkowitzByQP
Solves for the optimal weights in the Markowitz formulation by critical line method. That is, /[ w_eff = argmin {q * (w' V w) - w'r}, w'1 = 1, w ≥ w_lower, w ≤ w_upper. /]
-
-
Constructor Summary
Constructors Constructor Description MarkowitzByCLM(Vector r, Matrix V)
Solves w_eff = argmin {q * (w' V w) - w'r}, w'1 = 1, w ≥ 0.MarkowitzByCLM(Vector r, Matrix V, Vector w_lower, Vector w_upper)
Solves w_eff = argmin {q * (w' V w) - w'r}, w'1 = 1, w ≥ w_lower, w ≤ w_upper.MarkowitzByCLM(Vector r, Matrix V, Vector w_lower, Vector w_upper, double benchmarkRate)
Constructs a Markowitz portfolio from expected future returns and future covariance for a given benchmark rate, with lower and upper limits on asset weights.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected Vector
getOptimalW(double q)
Solves w_eff = argmin {q * (w' Σ w) - w'r}.-
Methods inherited from class tech.nmfin.portfoliooptimization.markowitz.MarkowitzByQP
fw, getOptimalRiskAversionCoefficient, getOptimalRiskAversionCoefficient, getOptimalWeights, getRiskAversionCoefficientForTargetReturn, getRiskAversionCoefficientForTargetVariance, setRiskAversionCoefficient
-
-
-
-
Constructor Detail
-
MarkowitzByCLM
public MarkowitzByCLM(Vector r, Matrix V)
Solves w_eff = argmin {q * (w' V w) - w'r}, w'1 = 1, w ≥ 0.- Parameters:
r
- the expected returnsV
- the covariance matrix
-
MarkowitzByCLM
public MarkowitzByCLM(Vector r, Matrix V, Vector w_lower, Vector w_upper)
Solves w_eff = argmin {q * (w' V w) - w'r}, w'1 = 1, w ≥ w_lower, w ≤ w_upper.- Parameters:
r
- the expected returnsV
- the covariance matrixw_lower
- the lower limits for weightsw_upper
- the upper limits for weights
-
MarkowitzByCLM
public MarkowitzByCLM(Vector r, Matrix V, Vector w_lower, Vector w_upper, double benchmarkRate)
Constructs a Markowitz portfolio from expected future returns and future covariance for a given benchmark rate, with lower and upper limits on asset weights.- Parameters:
r
- expected future returns of assetsV
- future covariance of assetsw_lower
- the lower limits for weightsw_upper
- the upper limits for weightsbenchmarkRate
- the benchmark rate used to compute Sharpe ratio
-
-
Method Detail
-
getOptimalW
protected Vector getOptimalW(double q) throws Exception
Description copied from class:MarkowitzByQP
Solves w_eff = argmin {q * (w' Σ w) - w'r}.- Overrides:
getOptimalW
in classMarkowitzByQP
- Parameters:
q
- the risk-aversion coefficient- Returns:
- the optimal weights w_eff
- Throws:
QPInfeasible
- when the underlying quadratic programming problem is infeasibleException
-
-