gohyuchen / Portfolio-risk-return

Codes for calculating mean returns, volatilities of stocks/portfolios, Mean Variance Optimization, Capital Asset Pricing Model and Value-at-Risk

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Portfolio-risk-return

Repository for codes related to finding the return and risk of securities and portfolios, mean-variance optimization and implementing the Capital Asset Pricing Model in Python.

Contents:

  1. return-risk-single - To calculate the annual return and volatility of a single stock and basic visualizations.
  2. return-risk-portfolio - To calculate the annual return, volatility, diversifiable risk of a portfolio of stocks. Also includes a comparison with a stock index (S&P500)
  3. ef-2-assets - To calculate the return and volatility of random portfolios containing two risky assets, to plot them and visually identify the efficient frontier
  4. mvo-portfolio-risky - To calculate the return and volatility of a portfolio containing many risky assets, to plot them and to rigorously calculate the efficient frontier using a mean variance optimizer function.
  5. two-fund-theorem - To calculate the return and volatility of a portfolio containing many risky assets and one riskfree asset. Here we also demonstrate the two-fund theorem
  6. beta-linreg - To calculate the beta of a stock using linear regression in Python
  7. var-single-asset - To calculate the Value-at-Risk of a single asset using historical returns in Python

About

Codes for calculating mean returns, volatilities of stocks/portfolios, Mean Variance Optimization, Capital Asset Pricing Model and Value-at-Risk


Languages

Language:Jupyter Notebook 100.0%