Investment Portfolio Analysis using R
Identification of over and under valued stocks, Portfolio Efficiency Analysis, Value At Risk (VaR) analysis and Monte Carlo Simulation using R
Introduction
An investment portfolio composed of equities was produced from another project, "Development of Optimal Investment Portfolio using R".
Throughout this project, financial analysis of equities used for development of the portfolio, portfolio efficiency analysis, Value At Risk (VaR) analysis of the portfolio and Monte Carlo Simulation on the portfolio were conducted. The instrument used for this project is open source software R.
Identification of over and under valued stocks
Financial Concepts
The following financial concepts were used for the identification of under or over valued stocks.
Capital Asset Pricing Model (CAPM)
The CAPM can be described as expected return of asset i equals to addition of risk free asset, such as US T-Bill, and Market Risk Premium. This financial concept was used to compute the expected return for each stock.
Security Market Line (SML)
The formula above underscores the formula for plotting the Security Market Line. The Security Market Line above is a visual of the Capital Asset Pricing Model (CAPM), where the x-axis of the graph represents risk in terms of beta, and the y-axis of the graph represents expected return.
The Security Market Line assumes that investors have to be compensated for both the time value of money and the corresponding level of risk associated with any investment, referred to as the risk premium.
When stocks' beta and expected return as well as the Security Market Line are plotted, if stocks' points appear above the Security Market Line, the stocks are considered undervalued because the position on the graph indicates that the stock offers a greater return against its inherent risk. On the other hand, if the stock plots below the Security Market Line, the stock is considered overvalued in price because the expected return does not overcome the inherent risk.
Selection of Securities
The following stocks that were used to develop the investment portfolio from another project, "Development of Optimal Investment Portfolio using R", were examined:
The examination period was set between end of 2016 February and end of 2016 March. During this examination, risk-free asst rate of return was 0.25% and the March benchmark (SP500) rate of return for March was 6.599111%.
Plotting of Security Market Line
Using each stock's expected return and beta, the stocks were plotted. Also, the Security Market Line based on the formula mentioned above was plotted as well. The plotting was done using R ggplot2 visualization package and the following highlights the plotting.
The chart above underlines that there is not much opportunity for arbitrage. In other words, there is not much opportunity for risk-free earning from the market as the stocks are on the line of Security Market Line. Miss-priced stocks are not evident from the chart. If stocks were below or above the Security Market Line, people could have either bought or sold the over-valued or under-valued stocks. The chart also addresses that stock related information is quickly reflected on the New York Stock Exchange or the "stock market"; therefore, people can, at least from the chart, consider that it is hard to find arbitrage opportunity or miss-priced stocks from NYSE.
Portfolio Efficiency Analysis
An Investment Portfolio can be considered as an efficient portfolio if the portfolio generates higher profit while having same risk compared to other portfolio; however, as the above image suggests, a portfolio can be considered as efficient portfolio if the portfolio generates same amount of profit with lower risk compared to other investment portfolio. This concept can be applied to the optimal investment portfolio produced from other project - "Development of Optimal Investment Portfolio using R" - to evaluate the efficiency of the optimal investment portfolio.
To conduct the evaluation the portfolio efficiency, the portfolio and each stock's expected return and standard deviation were computed using CAPM and R regression analysis. The examination period was set between 2010-01-01 and 2015-12-31. Based on the acquired data, the stocks and the optimal investment portfolio were plotted using R ggplot2 package.
As shown above, x-axis represents the level of risk, as measured by standard deviation, for each asset while y-axis represents expected return of each asset. The visualized chart using R unequivocally highlights that the Optimal Investment Portfolio is efficient investment asset compared to other asset as it has relatively very low risk but generates reasonable expected return compared with other investment assets.
Value at Risk (VaR) Analysis using R
Financial Concepts
VaR
Value at Risk measures the amount of potential loss that could happen in an investment or a portfolio of investments over a given time period. Value at Risk does not measure the actual amount of loss.
For example, if 1 week VaR at 95% confidence level is $10,000, this means the followings:
1) The probability that the amount of loss on investment position due to risk factors in 1 week will be less than $10,000 is 95%. We are 95% confident that the potential loss would be less than $10,000.
2) The probability that the amount of loss on investment position due to risk factors in 1 week will be greater than $10,000 is 5%. We are 5% confident that the potential loss would be greater than $10,000.
VaR Calculations
There are two main methods to compute VaR:
1. Historical Method: re-organize actual historical returns, putting them in order form worst to best. Depending on confidence level, the VaR will be different. This method assumes that history will repeat itself, from a risk perspective.
2. Variance-Covariance Method: assumes that stock returns are normally distributed. Similar to historical method except that this method uses familiar curve instead of actual data.
Optimal Investment Portfolio Value at Risk (VaR)
In order to compute VaR for the portfolio, historical method was used, assuming that stock returns are not normally distributed. The target period was between 2010-01-01 and 2015-12-31. The confidence level of 95% or 5% Value at Risk (VaR) was computed during the project and 1 month was chosen for the VaR time period.
As mentioned before, the optimal portfolio is composed of 10 stocks. In order to compute the optimal portfolio 1 month 5% VaR, 1 month 5% VaR of each stock must be computed, applied to optimal portfolio ratios and summed together.
Data for each stock's monthly return between 2010-01-01 and 2015-12-31 was acquired.
The following histograms show each stock's historical monthly return distribution between 2010-01-01 and 2015-12-31. The histograms were plotted using R and aforementioned data.
As the examining period is between 2010-01-01 and 2015-12-31 and the monthly return is examined, there are total of 72 instances or rows in the data and 10 columns to denote each stock.
As mentioned, the project aimed to compute VaR with 95% confidence level and hence 5% VaR, 4th from the sorted worst return was picked for each stock (72 X 0.05 = 3.6 or 4)
After obtaining the 4th worst return from each stock, each return was multiplied by relative weight (relative ratios of Optimal Investment Portfolio) and summed up together.
The process was done through R as shown below.
Result
The following highlights the 1 Month 5% VaR of the Optimal Investment Portfolio.
*12 represents 12 months and 250 represents 250 trading days per year.
Monte Carlo Simulation
Through Monte Carlo Simulation, the optimal portfolio's expected yearly return and its volatility, as measured by standard deviation, are computed.
In order to compute the portfolio's yearly return and its volatility, the most frequent return in 1 year and its volatility of stocks (which make up the portfolio) were computed first using Monte Carlo Simulation and the returns as well as their volatility were multiplied by relative weights that are contributing to the whole Optimal Portfolio.
Once the returns as well as their volatility were multiplied with the relative weights, the returns were summed together to produce the optimal portfolio average yearly return and their volatility were summed together to produce the optimal portfolio yearly average return's volatility. After acquiring the portfolio yearly return and volatility yearly return, Monte Carlo Simulation was carried out to produce the Optimal Portfolio's expected yearly return and its volatility.
Throughout the Monte Carlo Simulation, Geometric Brownian Motion was utilized to compute stock or portfolio's most frequent return and its volatility.
The examination period set between 2015-01-01 and 2015-12-31.
Each stock's monthly return during the examination period was acquired.
The function was developed during the project to conduct computations using Monte Carlo Simulation as shown below.
The following underscores where and how Geometric Brownian Motion was used.
After applying the optimal ratios to each stocks' returns and volatility, the summed values were used for running Monte Carlo Simulation for computing the most frequent or expected 1 year portfolio return and its volatility.
The following highlights distribution of monthly return of the Optimal Portfolio in one year after conducting Monte Carlo Simulation based on the summed values.
The following highlights the result of Monte Carlo Simulation.
0コメント