# k21173582/value-at-risk architecture

> Architecture diagram of the GitHub repository k21173582/value-at-risk, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-11-14). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/k21173582/value-at-risk
- Repository: https://github.com/k21173582/value-at-risk

## Overview

This is a small collection of standalone Python examples for calculating Value at Risk (VaR) and Expected Shortfall (ES). The user runs a chosen method, which downloads AAPL price history from Yahoo Finance, computes the method-specific risk measures, prints them, and visualizes the results. Each script implements its workflow in one file; the excerpts do not show a shared application layer or orchestration. The graph reflects those standalone workflows rather than implying they call one another.

Main entry points: [`Historical Method VaR.py`](https://github.com/k21173582/value-at-risk/blob/main/Historical%20Method%20VaR.py) (Historical Method), [`Variance-Covariance Method VaR.py`](https://github.com/k21173582/value-at-risk/blob/main/Variance-Covariance%20Method%20VaR.py) (Variance-Covariance Method), [`Monte Carlo Method VaR.py`](https://github.com/k21173582/value-at-risk/blob/main/Monte%20Carlo%20Method%20VaR.py) (Monte Carlo Method)

## Diagram (Mermaid)

```mermaid
flowchart TD

node_user(("Analyst"))
node_yahoo["Yahoo Finance"]
node_historical["Historical Method"]
node_covariance["Variance-Covariance Method"]
node_montecarlo["Monte Carlo Method"]

node_user -->|"runs"| node_historical
node_user -->|"runs"| node_covariance
node_user -->|"runs"| node_montecarlo
node_historical -->|"downloads prices"| node_yahoo
node_covariance -->|"downloads prices"| node_yahoo
node_montecarlo -->|"downloads prices"| node_yahoo

click node_historical "https://github.com/k21173582/value-at-risk/blob/main/Historical%20Method%20VaR.py"
click node_covariance "https://github.com/k21173582/value-at-risk/blob/main/Variance-Covariance%20Method%20VaR.py"
click node_montecarlo "https://github.com/k21173582/value-at-risk/blob/main/Monte%20Carlo%20Method%20VaR.py"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_user,node_yahoo toneIndigo
class node_historical,node_covariance,node_montecarlo toneTeal
```

## Components

### Other components

- **Analyst**
- **Yahoo Finance**
- [Historical Method](https://github.com/k21173582/value-at-risk/blob/main/Historical%20Method%20VaR.py): `Historical Method VaR.py`
- [Variance-Covariance Method](https://github.com/k21173582/value-at-risk/blob/main/Variance-Covariance%20Method%20VaR.py): `Variance-Covariance Method VaR.py`
- [Monte Carlo Method](https://github.com/k21173582/value-at-risk/blob/main/Monte%20Carlo%20Method%20VaR.py): `Monte Carlo Method VaR.py`

## Connections

- Analyst → Historical Method: runs (evidence: `README.md`)
- Analyst → Variance-Covariance Method: runs (evidence: `README.md`)
- Analyst → Monte Carlo Method: runs (evidence: `README.md`)
- Historical Method → Yahoo Finance: downloads prices (evidence: `Historical Method VaR.py`)
- Variance-Covariance Method → Yahoo Finance: downloads prices (evidence: `Variance-Covariance Method VaR.py`)
- Monte Carlo Method → Yahoo Finance: downloads prices (evidence: `Monte Carlo Method VaR.py`)
