File Exchange

image thumbnail

Simple Portfolio Optimization Methods

version (7.68 KB) by Semin Ibisevic
Myopic, Constant or Buy-and-Hold and Dynamic Strategies to calculate the optimal portfolio weight.


Updated 11 Feb 2012

View License

This package allows you to calculate simple portfolio weights using the myopic, buy-and-hold or dynamic strategies.

To demonstrate how to use the simple portfolio optimization techniques, multiple paths are simulated based on various horizons. This will give the user the flexibility to adapt the code to its own preferences. In this tutorial we replicate some of the features of the discrete time Bellman equation. See Li and Ng (2001) and Van Binsbergen (2007).

The following assumptions are relevant:
- A tradeoff is made between the returns and the risk free rate 'rf'
- Weights are restricted between 0 and 1.

To calculate the optimal portfolios we make use of the following three steps:
1. simulate 'n' sample paths of 'k' periods of the asset returns and predictor variables
2. set up a portfolio grid (done inside the functions)
3. calculate the optimal portfolio


B.F. Diris. Portfolio Management. Econometric Institute, 2012. Lecture FEM21010.

D. Li and W-L. Ng, 2001, Optimal Dynamic Portfolio Selection: Multiperiod Mean-Variance Formulation, Mathematical Finance, Volume 10 (issue 3).

Brand and Van Binsbergen, 2007, Optimal Asset Allocation in Asset Liability Management, NBER Working Paper No. 12970.

Cite As

Semin Ibisevic (2020). Simple Portfolio Optimization Methods (, MATLAB Central File Exchange. Retrieved .

Comments and Ratings (2)


I have a question regarding the dynamic strategy: How do you obtain the optimal weights for the future periods? Do you just take the mean over all optimal weights which were determined in the procedure by evaluating the utility values?

Andoni Olaeta


MATLAB Release Compatibility
Created with R2010a
Compatible with any release
Platform Compatibility
Windows macOS Linux

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!