jim lung
December 4, 2018
Title: Portfolio Optimization
Aim: - Use mathematical models to make a decision for portfolio optimization - Investigating portfolio optimization with expected return on investiment in risk control
In the following sections, we use a variety of mathematical tools to perform the following tasks:
Construct a vector of tickers and gather prices for them using the getSymbols function within quantmod. We will next calculate returns and convert the data to a time series object.
| Ticker | Stocks |
|---|---|
| AAPL | Apple Inc. |
| AMD | Advanced Micro Devices, Inc. |
| ADI | Analog Devices, Inc. |
| ABBV | AbbVie Inc |
| AET | AETNA INC |
| A | Agilent Technologies Inc |
| APD | Air Products & Chemicals, Inc. |
| AA | Alcoa Corp |
| CF | CF Industries Holdings, Inc. |
Calculate returns
## 'getSymbols' currently uses auto.assign=TRUE by default, but will
## use auto.assign=FALSE in 0.5-0. You will still be able to use
## 'loadSymbols' to automatically load data. getOption("getSymbols.env")
## and getOption("getSymbols.auto.assign") will still be checked for
## alternate defaults.
##
## This message is shown once per session and may be disabled by setting
## options("getSymbols.warning4.0"=FALSE). See ?getSymbols for details.
##
## WARNING: There have been significant changes to Yahoo Finance data.
## Please see the Warning section of '?getSymbols.yahoo' for details.
##
## This message is shown once per session and may be disabled by setting
## options("getSymbols.yahoo.warning"=FALSE).
## pausing 1 second between requests for more than 5 symbols
## pausing 1 second between requests for more than 5 symbols
## pausing 1 second between requests for more than 5 symbols
## pausing 1 second between requests for more than 5 symbols
## pausing 1 second between requests for more than 5 symbols
Use adjusted closed price to plot graph from 2017 until now:
Adjusted price
To compare the average yearly return, AMD and AET are the most increasing return yearly.
Investors are risk averse in that they prefer higher return for a given level of risk (variance, standard deviation), or they want to minimize risk for a given level of returns, so we go to minimize the variance and maximize the return.
The average monthly return of the portofolio at the evenly distributed allocation is 6.8 %. After optimization, the average monthly return of portfolio is -0.436 % when the global variance is at minimum 0.048. The maximized monthly return of portfolio is 1.904 % when the global variance is 0.0915.
The minimax model will maximize return with respect to one of these prior distributions providing valuable insight regarding an investor’s risk attitude and decision behavior.
Average monthly return is 8.6%, After optimization, mininum average loss is 6.49 % when variance is 1e+07.
Modeling linear vs log returns: Now we are ready to obtain the sample estimates from the returns\(\mathbf{x}_t\)
We will start with a daily rebalancing since we already have the daily returns readily available.
Compute the three corresponding GMV portfolios:
.
By portfolio allocation, AAPL, AET and APD are shown the most positive in investing value, but it is not significate in difference between log and tranformation.
Uniform portfolio: The uniform portfolio allocation
Global Minimum Variance Portfolio (GMVP): \[ \begin{array}{ll} \underset{\mathbf{w}}{\textsf{minimize}} & \mathbf{w}^T\mathbf{\Sigma}\mathbf{w}\\ {\textsf{subject to}} & \mathbf{1}^T\mathbf{w} = 1\\ & \mathbf{w}\ge\mathbf{0} \end{array}\]tes equal weight to each stock: \(\mathbf{w} = \frac{1}{N}\mathbf{1}\)
Markowitz portfolio: \[\begin{array}{ll} \underset{\mathbf{w}}{\textsf{maximize}} & \boldsymbol{\mu}^T\mathbf{w} -\lambda\mathbf{w}^T\mathbf{\Sigma}\mathbf{w}\\ {\textsf{subject to}} & \mathbf{1}^T\mathbf{w} = 1\\ & \mathbf{w}\ge\mathbf{0} \end{array}\]
.
.
.
.
.
We can conclude with the following points: