Class SOCPPortfolioObjectiveFunction
java.lang.Object
dev.nm.solver.multivariate.constrained.convex.sdp.socp.problem.portfoliooptimization.SOCPPortfolioObjectiveFunction
- All Implemented Interfaces:
Function<Vector,
,Double> RealScalarFunction
Constructs the objective function for portfolio optimization. The general form is:
\[
b'z = -\bar{r}^{\top}(w^0+x)+\lambda_r t_1+\lambda_c t_2
\]
, where \(t_{1}\in\mathbb{R}^{1}\) and \(t_{2}\in\mathbb{R}^{1}\) are usually the portfolio risk
and market impact terms respectively. \(\bar{r}\) is the expected portfolio return.
By letting \(y=x+w^{0}\), the objective function becomes: \[ -\bar{r}^{\top}y+\lambda_rt_1+\lambda_ct_2 \]
-
Nested Class Summary
Nested classes/interfaces inherited from interface dev.nm.analysis.function.Function
Function.EvaluationException
-
Constructor Summary
ConstructorsConstructorDescriptionSOCPPortfolioObjectiveFunction
(Matrix returns, double[] lambda, SOCPRiskConstraint risk, SOCPPortfolioConstraint impact) Constructs the objective function for an SOCP portfolio optimization (minimization) problem.SOCPPortfolioObjectiveFunction
(Matrix returns, double lambda, SOCPRiskConstraint risk) Constructs the objective function for an SOCP portfolio optimization (minimization) problem without a market impact term.SOCPPortfolioObjectiveFunction
(Vector r_bar, double[] lambda, SOCPRiskConstraint risk, SOCPPortfolioConstraint impact) Constructs the objective function for an SOCP portfolio optimization (minimization) problem.SOCPPortfolioObjectiveFunction
(Vector r_bar, double lambda, SOCPRiskConstraint risk) Constructs the objective function for an SOCP portfolio optimization (minimization) problem without a market impact term. -
Method Summary
Modifier and TypeMethodDescriptionb()
Gets the objective vector, b, in the compact form.int
Get the number of variables the function has.int
Get the dimension of the range space of the function.Computes the final objective function value.Gets the portfolio constraints represented in the objective function.Gets the variables involved in the portfolio constraints implied by the objective function.
-
Constructor Details
-
SOCPPortfolioObjectiveFunction
public SOCPPortfolioObjectiveFunction(Matrix returns, double[] lambda, SOCPRiskConstraint risk, SOCPPortfolioConstraint impact) Constructs the objective function for an SOCP portfolio optimization (minimization) problem.- Parameters:
returns
- the return matrixlambda
- the coefficients of the portfolio risk and market impact termsrisk
- the portfolio risk termimpact
- the market impact term
-
SOCPPortfolioObjectiveFunction
public SOCPPortfolioObjectiveFunction(Vector r_bar, double[] lambda, SOCPRiskConstraint risk, SOCPPortfolioConstraint impact) Constructs the objective function for an SOCP portfolio optimization (minimization) problem.- Parameters:
r_bar
- the vector of average returnslambda
- the coefficients of the portfolio risk and market impact termsrisk
- the portfolio risk termimpact
- the market impact term
-
SOCPPortfolioObjectiveFunction
Constructs the objective function for an SOCP portfolio optimization (minimization) problem without a market impact term.- Parameters:
returns
- the return matrixlambda
- the coefficients of the portfolio risk termsrisk
- the portfolio risk term
-
SOCPPortfolioObjectiveFunction
Constructs the objective function for an SOCP portfolio optimization (minimization) problem without a market impact term.- Parameters:
r_bar
- the vector of average returnslambda
- the coefficients of the portfolio risk termsrisk
- the portfolio risk term
-
-
Method Details
-
getVariables
Gets the variables involved in the portfolio constraints implied by the objective function.- Returns:
- the variables involved in the portfolio constraints implied by the objective function
-
getPortfolioConstraints
Gets the portfolio constraints represented in the objective function.- Returns:
- the portfolio constraints represented in the objective function
-
b
Gets the objective vector, b, in the compact form.- Returns:
- the objective vector, b
-
evaluate
Computes the final objective function value. -
dimensionOfDomain
public int dimensionOfDomain()Description copied from interface:Function
Get the number of variables the function has. For example, for a univariate function, the domain dimension is 1; for a bivariate function, the domain dimension is 2.- Specified by:
dimensionOfDomain
in interfaceFunction<Vector,
Double> - Returns:
- the number of variables
-
dimensionOfRange
public int dimensionOfRange()Description copied from interface:Function
Get the dimension of the range space of the function. For example, for a Rn->Rm function, the dimension of the range is m.- Specified by:
dimensionOfRange
in interfaceFunction<Vector,
Double> - Returns:
- the dimension of the range
-