##
# Example usage
Rf <- rnorm(250, 0.03, 0) # Constant 3% risk free rate
Ri <- rnorm(250, 0.13, 0.10) # Asset under study
Rm <- rnorm(250, 0.09, 0.04) # Market's (can be an index) returns
example <- capm(Rf,Ri,Rm)
print(example)
#You can add a data.frame with real data
#Choose a vector with the risk free rate (Rf)
#Choose a vector with the stock returns (Ri)
#Choose a vector with the market returns (Rm)
Run the code above in your browser using DataLab