Skip to content

Latest commit

 

History

History
18 lines (11 loc) · 1.02 KB

README.md

File metadata and controls

18 lines (11 loc) · 1.02 KB

Python-Coherent-Risk-Measures

Python scripts for four risk measurement models, including Value at Risk (VAR), Conditional Value at Risk (CVaR), Markowitz, and Mean-Variance Model

I compiled 232 indexes based on their closing prices from Tehran's stock market for 103 consecutive months. Each notebook consists of three blocks:

  • Data preparation and transforming them into a pseudo-convex matrix (You need pandas and numpy)
  • Modeling linear or quadratic programming (You need gurobipy and a valid license)
  • Solving and iterating over different returns to get risk values (You need matplotlib)

A sample output (Pareto):

dfVaR_return_risk

A sample output (Diversifying Power):

dfVaR_diversity

A quick note: I transformed the VaR model into a Second Order Cone Program (SOCP) via the epigraph property.