Goal

Calculate and visualize your portfolio’s beta.

Choose your stocks and the baseline market.

from 2012-12-31 to present

1 Import stock prices

2 Convert prices to returns

3 Assign a weight to each asset

## [1] "AMZN" "TM"   "TSLA"
## [1] 0.50 0.25 0.25
## # A tibble: 3 × 2
##   symbols weights
##   <chr>     <dbl>
## 1 AMZN       0.5 
## 2 TM         0.25
## 3 TSLA       0.25

4 Build a portfolio

## # A tibble: 60 × 2
##    date        returns
##    <date>        <dbl>
##  1 2013-01-31  0.0595 
##  2 2013-02-28 -0.00259
##  3 2013-03-28  0.0284 
##  4 2013-04-30  0.0954 
##  5 2013-05-31  0.181  
##  6 2013-06-28  0.0455 
##  7 2013-07-31  0.0992 
##  8 2013-08-30  0.0204 
##  9 2013-09-30  0.104  
## 10 2013-10-31  0.0313 
## # ℹ 50 more rows

5 Calculate CAPM Beta

5.1 Get market returns

5.2 Join returns

5.3 CAPM Beta

## # A tibble: 1 × 1
##   CAPM.beta.1
##         <dbl>
## 1        1.10

6 Plot

Scatter with regression line

Actual versus fitted returns

How sensitive is your portfolio to the market? Discuss in terms of the beta coefficient. Does the plot confirm the beta coefficient you calculated?

You can see that the portfolio does tend to follow the trend of the market but certainly has points where it outperforms the market and vise versa. The Beta coefficient is 1.10 which is above 1.0 meaning it is more volatile than the market. The plot does confirm the beta coefficient calculated.