Calculating beta using co-variance
Beta is an essential component of many financial models, and is a measure of systematic risk, or exposure to the broad market. In the CAPM model, beta is one of two essential factors.
Historical beta can be estimated in a number of ways. In this exercise, you will use the following simple formula involving co-variance and variance to a benchmark market portfolio:
$$ \beta_P = \frac{Cov(R_P, R_B)}{Var(R_B)} $$
- \(\beta_P\): Portfolio beta
- \(Cov(R_P, R_B)\): The co-variance between the portfolio (P) and the benchmark market index (B)
- \(Var(R_B)\): The variance of the benchmark market index
The FamaFrenchData
DataFrame is available in your workspace and contains the proper data for this exercise.
Diese Übung ist Teil des Kurses
Introduction to Portfolio Risk Management in Python
Interaktive Übung zum Anfassen
Probieren Sie diese Übung aus, indem Sie diesen Beispielcode ausführen.
# Calculate the co-variance matrix between Portfolio_Excess and Market_Excess
covariance_matrix = FamaFrenchData[['Portfolio_Excess', 'Market_Excess']]____
# Extract the co-variance co-efficient
covariance_coefficient = covariance_matrix.iloc[0, 1]
print(covariance_coefficient)