Skip to content

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

Notifications You must be signed in to change notification settings

namakshenas/Python-Coherent-Risk-Measures

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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.

About

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

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published