It ain't over
You made it! This journey showed you how to compute returns, analyze portfolio performance, and optimize portfolios. These are important skills since whenever you hold or manage more than one asset, you have a portfolio to consider.
It is now time to compound and get an extra return by exploring other useful R packages for portfolio analysis like PortfolioAnalytics. Instead of optimizing the portfolio by minimizing the variance under a return target constraint, this package allows you to optimize virtually all objective functions under all possible constraints. Even if the solution to the problem is not feasible, it will give you the best possible solution using heuristics, such as differential evolution in the R package DEoptim. Since I have been involved in both packages, this last exercise is an act of shameless self-promotion.
Have fun!
This exercise is part of the course
Introduction to Portfolio Analysis in R
Exercise instructions
- Load the package PortfolioAnalytics
- Explore the functionality of this package by entering the instruction
?PortfolioAnalytics
. - Read my article on portfolio optimization with DEoptim.
Hands-on interactive exercise
Have a go at this exercise by completing this sample code.
# Load the package PortfolioAnalytics
# Explore PortfolioAnalytics
# Happy reading!