Author

Beniamino Sartini

Published

April 3, 2025

1 Beta

Code
capm <- crypto_capm(symbols = colnames(df_capm)[-c(1,2)], Rf = Rf,  df_capm = df_capm)
capm %>%
  knitr::kable()
Symbol Beta Rf R2 Sigma AIC
BNB 1.0927503 0.0041667 0.4105668 0.2745903 13.864049
XRP 0.6363296 0.0041667 0.1320037 0.3422054 32.795316
ADA 0.9467209 0.0041667 0.3116618 0.2950666 20.049248
SOL 1.4243239 0.0041667 0.3272095 0.4283262 52.100069
MATIC 0.9261457 0.0041667 0.1820596 0.4116918 48.693593
ATOM 0.9153033 0.0041667 0.3629870 0.2542919 7.259484
FTM 1.5829200 0.0041667 0.3068928 0.4988899 65.215088
PAXG 0.0237309 0.0041667 0.0127602 0.0437760 -144.048689
Code
security_market_line = tibble(
  Beta = seq(min(capm$Beta), max(capm$Beta), 0.01),
  MeanRet = (1 - Beta)*(capm$Rf[1]) + Beta * mean(df_capm$BTC, na.rm = TRUE),
  Riskier = ifelse(Beta > 1, "Yes", "No")
)
Code
mean_ret_BTC <- mean(df_capm$BTC, na.rm = TRUE)

capm$MeanRet <- capm$Rf + capm$Beta * (mean_ret_BTC-capm$Rf)
capm <- arrange(capm, desc(Beta))
capm$indicator <- rep(c(1,-1), 4)
capm$Riskier <- ifelse(capm$Beta > 1, "Yes", "No")
ggplot()+
  geom_line(data = security_market_line, aes(Beta, MeanRet, color = Riskier), linewidth = 2)+
  geom_point(data = capm, aes(Beta, MeanRet), size = 2) +
  geom_segment(data = capm, aes(x = Beta, xend = Beta, y = MeanRet, yend = MeanRet+ 1/3*MeanRet*indicator), 
               size = 0.4) +
  geom_label(data = capm, aes(x = Beta, y = MeanRet+ 1/3*MeanRet*indicator, label = Symbol, color = Riskier), 
             size = 2) +
  scale_color_manual(values = c(Yes = "green", No = "red") )+
  theme_bw()+
  theme(legend.position = "top") + 
  labs(x = "Beta", y = "Return", color = "Is positively correlated with Bitcoin?")

Back to top

Citation

BibTeX citation:
@online{sartini2025,
  author = {Sartini, Beniamino},
  title = {Crypto {CAPM}},
  date = {2025-04-03},
  url = {https://cryptoverser.org/articles/bitcoin-capm/crypto-capm.html},
  langid = {en}
}
For attribution, please cite this work as:
Sartini, Beniamino. 2025. “Crypto CAPM.” April 3, 2025. https://cryptoverser.org/articles/bitcoin-capm/crypto-capm.html.