What is the Capital Asset Pricing Model (CAPM)?
The Capital Asset Pricing Model (CAPM) is a financial model used to determine the expected return on an asset, based on its risk relative to the overall market. The CAPM helps investors assess whether an investment is worthwhile, given its risk and the expected return.
Formula for Capital Asset Pricing Model (CAPM)
The formula for calculating the expected return using the CAPM is:
E(R) = Rf + β × (E(Rm) – Rf)
Where:
- E(R) = Expected return on the asset
- Rf = Risk-free rate (typically the return on government bonds)
- β = Beta of the asset (a measure of the asset’s volatility compared to the market)
- E(Rm) = Expected return of the market
How to Calculate Expected Return Using CAPM
Using the CAPM formula, you can calculate the expected return on an asset by plugging in values for the risk-free rate, the asset’s beta, and the expected market return.
Python Code to Calculate CAPM:
# Python Code to Calculate Expected Return using CAPM
def calculate_capm(rf, beta, rm):
expected_return = rf + beta * (rm - rf)
return expected_return
# Example Inputs
rf = 0.03 # Risk-free rate (3%)
beta = 1.2 # Asset's Beta
rm = 0.08 # Expected market return (8%)
# Calculate Expected Return using CAPM
expected_return = calculate_capm(rf, beta, rm)
print(f"The expected return on the asset using CAPM is: {expected_return*100:.2f}%")
Understanding the Code
The Python code calculates the expected return on an asset based on the CAPM formula. The code takes the following inputs:
- Risk-free rate (Rf): 3%
- Asset Beta (β): 1.2
- Expected market return (Rm): 8%
The output of the code will display the expected return on the asset in percentage form.
Download CAPM Guide PDF Go to CAPM Calculator