# 3 Beta Estimation

**Exercises:**

- Read in the clean CRSP data (
`crsp_monthly`

) set from the`tidy_finance.sqlite`

file (if you do not recall how to do this, check the previous chapter - Read in the Fama-French monthly market returns (
`factors_ff_monthly`

) from the`tidy_finance.sqlite`

database - compute the market beta \(\beta_\text{AAPL}\) of ticker
`AAPL`

(`permno == 14593`

). You can use the function`lm()`

for that purpose (alternatively: compute the well-known OLS estimate \((X'X)^{-1}X'Y\) on your own). - For monthly data, it is common to compute \(\beta_i\) based on a rolling window of length 5 years. Implement a rolling procedure that estimates assets market beta each month based on the last 60 observations. You can either use the package
`slider`

or a simple`for`

loop for that. (*Note*: this is going to be a time-consuming computational task) - Store the beta estimates in the
`tidy_finance.sqlite`

database as`beta`

- Provide summary statistics for the cross-section of estimated betas
- What is the theoretical prediction of CAPM with respect to the relationship between market beta and expected returns? What would you expect if you create portfolios based on beta (you create a high- and a low-beta portfolio each month and track the performance over time)? How should the expected returns differ between high and low beta portfolios?

**Solutions:**
All solutions are provided in the book chapter Beta estimation