PORTFOLIO ANALYSIS R语言投资组合MODEL (CAPM) & CONSTRUCT STOCK PORTFOLIOS

这是我的写的一篇关于用R语言实现MODEL (CAPM) & CONSTRUCT STOCK PORTFOLIOS的文章!希望能让大家看看!
Portfolio analysis

Abstract

The construction of investment portfolio is a perennial question in the analysis of financial investment. For years, the academic field and the industrial field have proposed many ways to optimize the portfolio. The theory of Markowitz mean-variance model (M-V model) takes the primary place. In the first part, this report introduces a method of constructing an effective stock portfolio with M-V model to establish effective frontier by using R. In the second part, we have built a simple simulation trading system for one stock by using R.

1 Construct portfolio
1.1 Introduction
The Standard & Poor’s 500 (abbreviated as S&P500), is an American stock market index based on the market capitalizations of 500 large companies having common stock listed on NYSE or NASDAQ. The S&P500 index has experienced a circle of bull market and bear market since 2013. So our sample encompasses a over 5-year period from January 2013 to April 2018.

image.png

1.2 portfolio construction
Companies like GOOGLE, IBM, MICROSOFT, APPLE and FACEBOOK are labeled as IT constitutes of S&P500 components. Companies like AFFIL MANAGERS, GOLDMAN SACHS, Citi Group, NASDAQ and MOODYS are labeled as financial constitutes of S&P500 components.

By R command getSymbols(), we get the historical market data of the ten stocks mentioned above and S&P500 index from yahoo finance website.

Supposing that one company can continue operating for more than 10 years, so we take 10-year US treasury interest rate as risk-free rate.

For simple, we construct two equal weighted portfolios:

image.png

The correlation matrix of IT stocks and S&P500 is listed as below.

GOOG/ MSFT/AAPL/FB are highly correlated with each other, IBM is negative correlated with other 4 stocks.

GOOG

IBM

MSFT

AAPL

FB

SPY

GOOG

   1.00

 -0.23

   0.98

   0.89

   0.97

   0.95

IBM

 -0.23

   1.00

 -0.19

 -0.29

 -0.31

 -0.21

MSFT

   0.98

 -0.19

   1.00

   0.92

   0.96

   0.97

AAPL

   0.89

 -0.29

   0.92

   1.00

   0.93

   0.97

FB

   0.97

 -0.31

   0.96

   0.93

   1.00

   0.97

SPY

   0.95

 -0.21

   0.97

   0.97

   0.97

   1.00

1.3 evaluation
The capital asset pricing model(CAPM), derived by Sharpe, Lintner and Mossin, is one of the most celebrated models in all of finance. The model describes the relationship we should expect to see between risk and return for individual assets. Specifically, the CAPM provides a way to calculate an asset’s expected return (or “required” return) based on its level of systematic (or market-related) risk, as measured by the asset’s beta.

For a portfolio, the equation for CAPM is

image.png

Which is the risky free rate, stands for the return of market, represents the sensitivity of the portfolio’s return to the market return.

Through linear regression, R command without intercept image.png, we can get the beta of two portfolios:

image.png

Beta is considered as the systematic risk, in a diversified portfolio, an investor should only be compensated for systematic risk (or beta) exposure. Beta reflects the relationship between the portfolio and the whole market. If beta is larger than 1, the portfolio earns more when the market goes up. If beta is smaller than 1, the portfolio loses less when the market goes down.

Form the linear regression results, we can see portfolio 1 and portfolio 2 both have beta greater than 1. When the marke

  • 0
    点赞
  • 4
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值