Class SOCPPortfolioObjectiveFunction
- java.lang.Object
-
- dev.nm.solver.multivariate.constrained.convex.sdp.socp.problem.portfoliooptimization.SOCPPortfolioObjectiveFunction
-
- All Implemented Interfaces:
Function<Vector,Double>
,RealScalarFunction
public class SOCPPortfolioObjectiveFunction extends Object implements 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.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface dev.nm.analysis.function.Function
Function.EvaluationException
-
-
Constructor Summary
Constructors Constructor Description SOCPPortfolioObjectiveFunction(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
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Vector
b()
Gets the objective vector, b, in the compact form.int
dimensionOfDomain()
Get the number of variables the function has.int
dimensionOfRange()
Get the dimension of the range space of the function.Double
evaluate(Vector y)
Computes the final objective function value.List<SOCPPortfolioConstraint>
getPortfolioConstraints()
Gets the portfolio constraints represented in the objective function.List<SOCPPortfolioConstraint.Variable>
getVariables()
Gets the variables involved in the portfolio constraints implied by the objective function.
-
-
-
Constructor Detail
-
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
public SOCPPortfolioObjectiveFunction(Matrix returns, double lambda, SOCPRiskConstraint risk)
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
public SOCPPortfolioObjectiveFunction(Vector r_bar, double lambda, SOCPRiskConstraint risk)
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 Detail
-
getVariables
public List<SOCPPortfolioConstraint.Variable> 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
public List<SOCPPortfolioConstraint> getPortfolioConstraints()
Gets the portfolio constraints represented in the objective function.- Returns:
- the portfolio constraints represented in the objective function
-
b
public Vector b()
Gets the objective vector, b, in the compact form.- Returns:
- the objective vector, b
-
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
-
-