Financial Toolbox

Asset Allocation and Portfolio Optimization

Financial Toolbox provides a comprehensive suite of portfolio optimization and analysis tools for performing capital allocation, asset allocation, and risk assessment. With these tools, you can:

  • Estimate asset return and total return moments from price or return data
  • Compute portfolio-level statistics, such as mean, variance, value at risk (VaR), and conditional value at risk (CVaR)
  • Perform constrained mean-variance portfolio optimization and analysis
  • Examine the time evolution of efficient portfolio allocations
  • Perform capital allocation
  • Account for turnover and transaction costs in portfolio optimization problems
Sample portfolio optimization application built using MATLAB, Financial Toolbox, and object-oriented design.
Portfolio optimization application built using MATLAB, Financial Toolbox, and object-oriented design. The application enables the interactive selection of a portfolio, comparison to a benchmark, visualization, and reporting of key performance metrics.

Object-Oriented Portfolio Construction and Analysis

The portfolio optimization object provides a simplified interface for defining and solving portfolio optimization problems that include descriptive metadata. You can specify a portfolio name, the number of assets in an asset universe, and asset identifiers. Additionally, you can define an initial portfolio allocation.

The toolbox supports two approaches to portfolio optimization:

  • Mean-variance portfolio optimization uses variance as a risk proxy. You define asset return moments either as arrays or as estimations from the return time series in a matrix or financial time series objects.
  • CVaR portfolio optimization uses conditional value at risk (CVaR) as a risk proxy. You work with simulations of asset returns data.

Supported constraints include: linear inequality, linear equality, bound, budget, group, group ratio, average turnover, and one-way turnover.

Additionally, you can work with transaction costs in the portfolio optimization problem definition. You apply transaction costs on either gross or net portfolio return optimization. Transaction costs can be proportional or fixed, and they are incorporated as units of total return.

Efficient frontiers plot for a sample portfolio optimization problem.
Efficient frontiers plot for a sample portfolio optimization problem with and without proportional transaction costs (TX) and turnover (TO) constraints.
Plot comparing efficient frontiers computed from mean-variance portfolio optimization with CVaR portfolio optimization.
Plot comparing efficient frontiers computed from mean-variance portfolio optimization with CVaR portfolio optimization.

Error Checking and Portfolio Validation

The portfolio optimization object provides error checking during the portfolio construction phase. For complex problems defined with multiple constraints, validating your inputs to or outputs from the portfolio optimization can reduce error-checking time prior to solving the optimization problem. Methods to estimate bounds and check problem feasibility are available.

Efficient Portfolio and Efficient Frontiers

Depending on your goals, you can identify efficient portfolios or efficient frontiers. The portfolio optimization object provides methods for both. You can solve for efficient portfolios by providing one or more target risks or returns.

To obtain optimal portfolios on the efficient frontier, you can

  • Specify the number of portfolios to find
  • Solve for the optimal portfolios at the efficient frontier endpoints
  • Extract the Sharpe ratio-maximizing portfolio

Additionally, you can model long-short portfolios with or without turnover constraints.

Plot of efficient frontiers with and without a turnover constraint of 130-30.
Plot of efficient frontiers with and without a turnover constraint of 130-30. The Sharpe-ratio maximized portfolio is marked with an X on the 130-30 efficient frontier.

Postprocessing and Trade Reporting

After you identify a portfolio’s risk and return, you can use the portfolio optimization object methods to:

  • Troubleshoot questionable results
  • Adjust the problem definition to move toward an efficient portfolio
  • Set up an asset trading record

The portfolio object supports the generation of a trade record as a dataset array. You can use the dataset array to keep track of purchases and sales of assets and to capture trades to execute.

Next: Risk and Investment Analysis

Try Financial Toolbox

Get trial software

Optimization in MATLAB for Financial Applications

View webinar

Attend MATLAB for Financial Application and Receive GARP Credit

Get details