Portfolio Optimization in R, Part 2

December 19, 2011

(This article was first published on Adventures in Statistical Computing, and kindly contributed to R-bloggers)

In the previous post, we built the efficient frontier of a portfolio of bonds. The next logical step is to find the super efficient (or market) portfolio holdings.  If you are unfamiliar with the concept, take a second and read the section section on Wikipedia.

If you decided not to read, I’ll paraphrase.  If you have a rate of return that is guaranteed (a risk free rate), then that asset sits on the y axis of our graph.  Draw a line through that point that is tangent to the frontier.  That point of tangency is the super efficient portfolio.  You can hold a weight of that portfolio and the risk free asset and achieve a better risk return profile than the frontier.

Got it?  Good.

So we need to find the line and the tangent point.  First let’s decided on the risk free rate.  Some people would use the 3 month treasury rate.  The rate needs to match your holding period and we are dealing with 1 year values.  My bank gives me a 2% CD for 1 year.  I will use 2%.

How do we find the point of tangency?  When we had 2 assets, we knew that we had a 2nd order polynomial.  With 3 assets we get kinks in the surface —  in this case where we stop allocating to SHY and start allocating to TLT.  We can fit a higher order polynomial, but we cannot ensure that we have a concave surface.  Or I could say, we cannot guarantee our point of tangency is always above the frontier.  Same thing. We can also have imaginary roots.  Or tangent points that are negative…

As an example, here is fitting a 6th order polynomial that fits the kinks but our tangent points are not useful.

Only 1 root is real; the rest are imaginary.  We need another methodology.

We could just fit a polynomial to the first part of the frontier; where only SHY and IEF are in the portfolio.  This would work, but it would not be very general.  I want to find a solution that gives an answer regardless of the shape of the frontier.  That is the topic of the next post.

In theory, there is no difference between theory and practice.  In practice, there is.  
— Yogi Berra

To leave a comment for the author, please follow the link and comment on their blog: Adventures in Statistical Computing.

R-bloggers.com offers daily e-mail updates about R news and tutorials on topics such as: Data science, Big Data, R jobs, visualization (ggplot2, Boxplots, maps, animation), programming (RStudio, Sweave, LaTeX, SQL, Eclipse, git, hadoop, Web Scraping) statistics (regression, PCA, time series, trading) and more...

If you got this far, why not subscribe for updates from the site? Choose your flavor: e-mail, twitter, RSS, or facebook...

Comments are closed.


Never miss an update!
Subscribe to R-bloggers to receive
e-mails with the latest R posts.
(You will not see this message again.)

Click here to close (This popup will not appear again)