Portfolio Optimization

PortfolioProblem

PortfolioResult

solve

OperationsResearchModels.solve — Method
solve(problem)

Description

Solves a portfolio optimization problem given by an object of in type PortfolioProblem. The optimization problem is formulated as a quadratic programming problem where the objective is to minimize the portfolio variance (risk) subject to constraints on the expected return and the weights.

Mathematically, the problem can be stated as:

Minimize: w' * Covmat * w

Subject to:

  • sum(w) == 1 (the weights must sum to 1)
  • sum(w[i] * means[i] for i in 1:m) >= thresholdreturn
  • 0 <= w[i] <= 1 for all i (weights must be between 0 and 1)

Where:

  • w is the vector of asset weights
  • Covmat is the covariance matrix of asset returns
  • means is the vector of expected returns for each asset
  • thresholdreturn is the minimum expected return required for the portfolio

Arguments

  • problem::PortfolioProblem: The problem in type of PortfolioProblem

Returns

  • PortfolioResult: The result of the portfolio optimization problem, containing the optimal weights, expected return, and the JuMP model used to solve the problem.

Example

using OperationsResearchModels

problem = PortfolioProblem(rand(100, 5), 0.01)
result = solve(problem)
println("Optimal Weights: ", result.weights)
println("Expected Return: ", result.expectedreturn)

See also PortfolioResult, solve(::PortfolioProblem)

source