Playing the Financial Market – Portfolio Optimization using AMPL

This was submitted as a project for my Optimization class in my MS Business Analytics program. The original title is “Playing the financial market: Optimizing Asset Allocation in a Portfolio”. My other teammates are Anh Duong and Kenneth Wu. This project was done for educational purposes only. Click the photos to enlarge. Check out the GitHub page for AMPL model.


Problem Statement

The purpose of this study is to determine the optimal allocation of investments in the S&P, BIL, and AGG. Questions about risk-return prioritization, market selection, and optimal asset allocation arise from the need to attain optimal returns with respect to one’s risk tolerance.


Data Description

The data used for this study consists of 10 years of market data from Yahoo Finance. This includes data on the S&P 500 Index, SPDR Bloomberg Barclays 1-3 Month T-Bill ETF (BIL), and iShares Core US Aggregate Bond ETF (AGG).

Model Selection

This study used the Markowitz mean-variance portfolio model, which focuses on the trade off between risk and return.

  • The model assumes that the historical returns of an asset, in this case, a financial market, is the expected return of the asset.
  • It also assumes that risk is based on the standard deviation of the returns and the correlation of returns between assets.
  • Every level of risk has a return-maximizing portfolio, and the optimal portfolio for an investor depends on its own level of risk-tolerance.

Summarization of Data

Based on their own historical performance, S&P 500, AGG, and BIL markets have expected return of 0.61%, 0.35%, and 0.03%, respectively. They have also maintained standard deviation or risk of 4.43%, 1.15%, and 0.13%, respectively.

In terms of correlative performance between the three markets, it is interesting to note that S&P 500 and BIL have a -0.22 correlation coefficient, while AGG and BIL have a 0.15 correlation coefficient. S&P 500 and AGG have a very low correlation of 0.04.

The covariances of each market pair are listed below:

Correlation x Std. Dev

Building the Model in AMPL

Just a few things to note about this model.

  • The red numbers are the covariances of Wi and Wj.
  • The purple number is the expected return that we want to get the risk of.

Results and Discussion

This particular model, with a targeted return of 0.1954%, which is the decompounded monthly risk-free rate, suggests that in order to minimize the risk to 0.00313596%, the portfolio should have the following allocation: 5.3622%, 42.7805%, and 51.8573% for S&P 500, AGG, and BIL, respectively.

That being said, based on our risk profile, we can choose the point a point on the efficient frontier (set of efficient portfolios), as long as it is greater or equal than the decompounded Monthly Risk-Free Rate (based on the 10-year T-Bill rate)


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s