- Introduction to R for Quantitative Finance
- Gergely Daróczi Michael Puhle Edina Berlinger
- 427字
- 2021-07-23 14:13:59
Chapter 2. Portfolio Optimization
By now we are familiar with the basics of the R language. We know how to analyze data, call its built-in functions, and apply them to the selected problems in a time series analysis. In this chapter we will use and extend this knowledge to discuss an important practical application: portfolio optimization, or in other words, security selection. This section covers the idea behind portfolio optimization: the mathematical models and theoretical solutions. To improve programming skills, we will implement an algorithm line by line using real data to solve a real-world example. We will also use the pre-written R packages on the same data set.
Imagine that we live in a tropical island and have only USD 100 to invest. Investment possibilities on the island are very limited; we can invest our entire fund into either ice creams or umbrellas. The payoffs that depend on the weather are as follows:

Suppose the probability of the weather being rainy or sunny is the same. If we cannot foresee or change the weather, the two options are clearly equivalent and we have an expected return of 5% [(0.5×120+0.5×90)/100-1=0.05] by investing in any of them.
What if we can split our funds between ice creams and umbrellas? Then we should invest USD 50 in both the options. This portfolio is riskless because whatever happens, we earn USD 45 with one asset and USD 60 with the other one. The expected return is still 5%, but now it is guaranteed since (45+60)/100-1=0.05.
The main concept of portfolio optimization (which won the Nobel Prize for Harry Markowitz in 1990) is captured in this example. Based on the correlation between investment products, we can reduce the risk (which in this case is measured by variance) of the portfolio and still get the desired expected return.
To be mathematically more precise, let X and Y be the random variables with the finite variances and
. The variance of their convex or affine combination is shown in the following quadratic function:

For different values of their correlation, this quadratic function looks like the following diagram:

The variance (as a measure of risk) can completely be eliminated if and only if the correlation between X and Y is -1 or +1, and the variance of X and Y are not the same. Otherwise, the variance of the portfolio with optimal weights depends (in an absolutely non-trivial way) on all the three parameters (,
, and
), as we will see later in the Theorem (Lagrange) section.
- Designing Purpose:Built Drones for Ardupilot Pixhawk 2.1
- Linux Mint Essentials
- Extending Puppet
- 高性能Linux服務(wù)器構(gòu)建實戰(zhàn):運維監(jiān)控、性能調(diào)優(yōu)與集群應(yīng)用
- Linux集群和自動化運維
- Application Development in iOS 7
- 計算機系統(tǒng):基于x86+Linux平臺
- Heroku Cloud Application Development
- 從零開始學(xué)安裝與重裝系統(tǒng)
- Linux應(yīng)用大全 基礎(chǔ)與管理
- 完美應(yīng)用Ubuntu(第2版)
- 應(yīng)急指揮信息系統(tǒng)設(shè)計
- 操作系統(tǒng)之哲學(xué)原理第2版
- Java EE 8 High Performance
- Gradle Effective Implementations Guide(Second Edition)