# arunp77/montecarlo-simulation architecture

> Architecture diagram of the GitHub repository arunp77/montecarlo-simulation, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-09-30). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/arunp77/montecarlo-simulation
- Repository: https://github.com/arunp77/montecarlo-simulation

## Overview

This repository is an educational Monte Carlo simulation project: its website and notebooks present simulation fundamentals, statistical methods, variance reduction, and finance applications. The principal hands-on workflow is to obtain or generate inputs, simulate outcomes, and inspect estimates or risk measures. The graph also includes the small Flask dice-simulation endpoint. Source evidence is limited to the README and sampled Python excerpts; notebook and website relationships beyond documented capabilities are not inferred.

Main entry points: [`app.py`](https://github.com/arunp77/montecarlo-simulation/blob/main/app.py) (Dice simulation API), [`Finance-risk/Adani-share.py`](https://github.com/arunp77/montecarlo-simulation/blob/main/Finance-risk/Adani-share.py) (Adani share analysis), [`Finance-risk/Reference-monte-carlo.py`](https://github.com/arunp77/montecarlo-simulation/blob/main/Finance-risk/Reference-monte-carlo.py) (VaR and CVaR), [`index.html`](https://github.com/arunp77/montecarlo-simulation/blob/main/index.html) (Learning website)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_learning["Simulation learning"]
  node_basics["Simulation basics"]
  node_covariance["Covariance analysis"]
  node_dice["Dice example<br/>[Dice-rolling.ipynb]"]
  node_walk["Random walk"]
end

subgraph group_finance["Finance applications"]
  node_risk["Risk analysis"]
  node_credit["Credit risk"]
  node_market["Market risk"]
  node_portfolio["Portfolio performance"]
  node_adani["Adani share analysis<br/>[Adani-share.py]"]
  node_varcvar["VaR and CVaR"]
end

subgraph group_web["Website and API"]
  node_site["Learning website<br/>[index.html]"]
  node_home["Home content<br/>[home.html]"]
  node_projects["Project listings<br/>[projects.html]"]
  node_financepage["Finance content"]
  node_marketpage["Market risk page<br/>[market-risk.html]"]
  node_contact["Contact page<br/>[contact.html]"]
  node_api["Dice simulation API<br/>[app.py]"]
end

subgraph group_methods["Simulation methods"]
  node_variance["Variance reduction"]
end

node_learner(("Learner"))
node_marketdata(("Market data<br/>external system"))

node_learner -->|"views"| node_site
node_learner -.->|"posts simulation"| node_api
node_api -->|"returns average"| node_api
node_adani -->|"downloads prices"| node_marketdata
node_varcvar -->|"downloads prices"| node_marketdata

click node_site "https://github.com/arunp77/montecarlo-simulation/blob/main/index.html"
click node_home "https://github.com/arunp77/montecarlo-simulation/blob/main/home.html"
click node_projects "https://github.com/arunp77/montecarlo-simulation/blob/main/projects.html"
click node_financepage "https://github.com/arunp77/montecarlo-simulation/blob/main/finanical-risk-analysis.html"
click node_marketpage "https://github.com/arunp77/montecarlo-simulation/blob/main/market-risk.html"
click node_contact "https://github.com/arunp77/montecarlo-simulation/blob/main/contact.html"
click node_basics "https://github.com/arunp77/montecarlo-simulation/blob/main/0.1-Monte-carlo-simulations.ipynb"
click node_covariance "https://github.com/arunp77/montecarlo-simulation/blob/main/0.2-covariance%20matrix.ipynb"
click node_dice "https://github.com/arunp77/montecarlo-simulation/blob/main/Other-example/Dice-rolling.ipynb"
click node_walk "https://github.com/arunp77/montecarlo-simulation/blob/main/Other-example/Random-walk-problem.ipynb"
click node_variance "https://github.com/arunp77/montecarlo-simulation/blob/main/0.3-Variance-reduction-techniques.py"
click node_api "https://github.com/arunp77/montecarlo-simulation/blob/main/app.py"
click node_risk "https://github.com/arunp77/montecarlo-simulation/blob/main/Finance-risk/0.1-Risk-analysis.ipynb"
click node_credit "https://github.com/arunp77/montecarlo-simulation/blob/main/Finance-risk/0.2-Credit-risk.ipynb"
click node_market "https://github.com/arunp77/montecarlo-simulation/blob/main/Finance-risk/0.2-Market-risk.ipynb"
click node_portfolio "https://github.com/arunp77/montecarlo-simulation/blob/main/Finance-risk/Portfolioperformance.ipynb"
click node_adani "https://github.com/arunp77/montecarlo-simulation/blob/main/Finance-risk/Adani-share.py"
click node_varcvar "https://github.com/arunp77/montecarlo-simulation/blob/main/Finance-risk/Reference-monte-carlo.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_basics,node_covariance,node_dice,node_walk toneBlue
class node_risk,node_credit,node_market,node_portfolio,node_adani,node_varcvar toneAmber
class node_site,node_home,node_projects,node_financepage,node_marketpage,node_contact,node_api toneMint
class node_variance toneRose
class node_learner,node_marketdata toneIndigo
```

## Components

### Simulation learning

- [Simulation basics](https://github.com/arunp77/montecarlo-simulation/blob/main/0.1-Monte-carlo-simulations.ipynb): `0.1-Monte-carlo-simulations.ipynb`
- [Covariance analysis](https://github.com/arunp77/montecarlo-simulation/blob/main/0.2-covariance%20matrix.ipynb): `0.2-covariance matrix.ipynb`
- [Dice example](https://github.com/arunp77/montecarlo-simulation/blob/main/Other-example/Dice-rolling.ipynb): `Other-example/Dice-rolling.ipynb`
- [Random walk](https://github.com/arunp77/montecarlo-simulation/blob/main/Other-example/Random-walk-problem.ipynb): `Other-example/Random-walk-problem.ipynb`

### Finance applications

- [Risk analysis](https://github.com/arunp77/montecarlo-simulation/blob/main/Finance-risk/0.1-Risk-analysis.ipynb): `Finance-risk/0.1-Risk-analysis.ipynb`
- [Credit risk](https://github.com/arunp77/montecarlo-simulation/blob/main/Finance-risk/0.2-Credit-risk.ipynb): `Finance-risk/0.2-Credit-risk.ipynb`
- [Market risk](https://github.com/arunp77/montecarlo-simulation/blob/main/Finance-risk/0.2-Market-risk.ipynb): `Finance-risk/0.2-Market-risk.ipynb`
- [Portfolio performance](https://github.com/arunp77/montecarlo-simulation/blob/main/Finance-risk/Portfolioperformance.ipynb): `Finance-risk/Portfolioperformance.ipynb`
- [Adani share analysis](https://github.com/arunp77/montecarlo-simulation/blob/main/Finance-risk/Adani-share.py): `Finance-risk/Adani-share.py`
- [VaR and CVaR](https://github.com/arunp77/montecarlo-simulation/blob/main/Finance-risk/Reference-monte-carlo.py): `Finance-risk/Reference-monte-carlo.py`

### Website and API

- [Learning website](https://github.com/arunp77/montecarlo-simulation/blob/main/index.html): `index.html`
- [Home content](https://github.com/arunp77/montecarlo-simulation/blob/main/home.html): `home.html`
- [Project listings](https://github.com/arunp77/montecarlo-simulation/blob/main/projects.html): `projects.html`
- [Finance content](https://github.com/arunp77/montecarlo-simulation/blob/main/finanical-risk-analysis.html): `finanical-risk-analysis.html`
- [Market risk page](https://github.com/arunp77/montecarlo-simulation/blob/main/market-risk.html): `market-risk.html`
- [Contact page](https://github.com/arunp77/montecarlo-simulation/blob/main/contact.html): `contact.html`
- [Dice simulation API](https://github.com/arunp77/montecarlo-simulation/blob/main/app.py): `app.py`

### Simulation methods

- [Variance reduction](https://github.com/arunp77/montecarlo-simulation/blob/main/0.3-Variance-reduction-techniques.py): `0.3-Variance-reduction-techniques.py`

### Other components

- **Learner**
- **Market data**: external system

## Connections

- Learner → Learning website: views (evidence: `README.md`)
- Learner → Dice simulation API: posts simulation
- Dice simulation API → Dice simulation API: returns average (evidence: `app.py`)
- Adani share analysis → Market data: downloads prices (evidence: `Finance-risk/Adani-share.py`)
- VaR and CVaR → Market data: downloads prices (evidence: `Finance-risk/Reference-monte-carlo.py`)
