# rousenghak/monte-carlo---likelihood-free-inference-and-sums-of-log-normal-variates architecture

> Architecture diagram of the GitHub repository rousenghak/monte-carlo---likelihood-free-inference-and-sums-of-log-normal-variates, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-09-25). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/rousenghak/monte-carlo---likelihood-free-inference-and-sums-of-log-normal-variates
- Repository: https://github.com/rousenghak/monte-carlo---likelihood-free-inference-and-sums-of-log-normal-variates
- Video tour (about a minute): https://gitdiagram.com/rousenghak/monte-carlo---likelihood-free-inference-and-sums-of-log-normal-variates/video

## Overview

This research project estimates parameters of sums of log-normal variates using likelihood-free inference. Its main workflow takes observed data and an epsilon tolerance, runs either Reject-ABC or MCMC-ABC, and produces posterior samples and summaries. The repository also documents epsilon and prior sensitivity, posterior-predictive checks, a Gibbs comparison, and method benchmarks. The core ABC implementation and benchmark calls are sampled; some notebook and experiment details are documented in the README or filenames but were not inspected, so uncertain wiring is omitted.

Main entry points: [`algorithms.py`](https://github.com/rousenghak/monte-carlo---likelihood-free-inference-and-sums-of-log-normal-variates/blob/main/algorithms.py) (Reject-ABC), [`benchmark2.py`](https://github.com/rousenghak/monte-carlo---likelihood-free-inference-and-sums-of-log-normal-variates/blob/main/benchmark2.py) (ABC benchmark), [`Reject_ABC.ipynb`](https://github.com/rousenghak/monte-carlo---likelihood-free-inference-and-sums-of-log-normal-variates/blob/main/Reject_ABC.ipynb) (Reject-ABC study), [`MCMC_ABC_optimizedv3.ipynb`](https://github.com/rousenghak/monte-carlo---likelihood-free-inference-and-sums-of-log-normal-variates/blob/main/MCMC_ABC_optimizedv3.ipynb) (MCMC-ABC study)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_model["Data model"]
  node_observations["Observed data"]
  node_simulator["Log-normal simulator<br/>[algorithms.py]"]
end

subgraph group_inference["ABC inference"]
  node_reject["Reject-ABC<br/>[algorithms.py]"]
  node_mcmc["MCMC-ABC<br/>[algorithms.py]"]
  node_notebook_reject["Reject-ABC study<br/>[Reject_ABC.ipynb]"]
  node_notebook_mcmc["MCMC-ABC study"]
  node_mcmc_base["MCMC base functions<br/>[MCMC_ABCv2.py]"]
  node_algorithms["ABC algorithms<br/>[algorithms.py]"]
end

subgraph group_evaluation["Method evaluation"]
  node_benchmark["ABC benchmark<br/>[benchmark2.py]"]
  node_benchmark_results["Benchmark results"]
  node_epsilon_study["Epsilon and Gibbs study"]
  node_epsilon_results["Epsilon results"]
end

subgraph group_analysis["Results analysis"]
  node_posterior["Posterior samples"]
  node_plot_analysis["Epsilon plots"]
end

node_researcher(("Researcher"))

node_researcher -->|"provides data"| node_observations
node_researcher -->|"runs study"| node_notebook_reject
node_researcher -->|"runs study"| node_notebook_mcmc
node_notebook_reject -.->|"documents use"| node_reject
node_notebook_mcmc -.->|"documents use"| node_mcmc_base
node_reject -->|"simulates proposals"| node_simulator
node_mcmc -->|"simulates proposals"| node_simulator
node_observations -->|"compares against"| node_reject
node_observations -->|"compares against"| node_mcmc
node_reject -->|"returns samples"| node_posterior
node_mcmc -->|"returns samples"| node_posterior
node_benchmark -->|"calls methods"| node_algorithms
node_benchmark -->|"writes results"| node_benchmark_results
node_epsilon_study -->|"writes results"| node_epsilon_results
node_epsilon_results -->|"loads data"| node_plot_analysis

click node_simulator "https://github.com/rousenghak/monte-carlo---likelihood-free-inference-and-sums-of-log-normal-variates/blob/main/algorithms.py"
click node_reject "https://github.com/rousenghak/monte-carlo---likelihood-free-inference-and-sums-of-log-normal-variates/blob/main/algorithms.py"
click node_mcmc "https://github.com/rousenghak/monte-carlo---likelihood-free-inference-and-sums-of-log-normal-variates/blob/main/algorithms.py"
click node_notebook_reject "https://github.com/rousenghak/monte-carlo---likelihood-free-inference-and-sums-of-log-normal-variates/blob/main/Reject_ABC.ipynb"
click node_notebook_mcmc "https://github.com/rousenghak/monte-carlo---likelihood-free-inference-and-sums-of-log-normal-variates/blob/main/MCMC_ABC_optimizedv3.ipynb"
click node_mcmc_base "https://github.com/rousenghak/monte-carlo---likelihood-free-inference-and-sums-of-log-normal-variates/blob/main/MCMC_ABCv2.py"
click node_benchmark "https://github.com/rousenghak/monte-carlo---likelihood-free-inference-and-sums-of-log-normal-variates/blob/main/benchmark2.py"
click node_algorithms "https://github.com/rousenghak/monte-carlo---likelihood-free-inference-and-sums-of-log-normal-variates/blob/main/algorithms.py"
click node_benchmark_results "https://github.com/rousenghak/monte-carlo---likelihood-free-inference-and-sums-of-log-normal-variates/blob/main/benchmark_results/benchmark_results.csv"
click node_epsilon_study "https://github.com/rousenghak/monte-carlo---likelihood-free-inference-and-sums-of-log-normal-variates/blob/main/estimating_espsilon_bias.py"
click node_epsilon_results "https://github.com/rousenghak/monte-carlo---likelihood-free-inference-and-sums-of-log-normal-variates/tree/main/epsilon_comparison"
click node_plot_analysis "https://github.com/rousenghak/monte-carlo---likelihood-free-inference-and-sums-of-log-normal-variates/blob/main/plots_epsilon_bias.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_observations,node_simulator toneBlue
class node_reject,node_mcmc,node_notebook_reject,node_notebook_mcmc,node_mcmc_base,node_algorithms toneAmber
class node_benchmark,node_benchmark_results,node_epsilon_study,node_epsilon_results toneMint
class node_posterior,node_plot_analysis toneRose
class node_researcher toneIndigo
```

## Components

### Data model

- **Observed data**
- [Log-normal simulator](https://github.com/rousenghak/monte-carlo---likelihood-free-inference-and-sums-of-log-normal-variates/blob/main/algorithms.py): `algorithms.py`

### ABC inference

- [Reject-ABC](https://github.com/rousenghak/monte-carlo---likelihood-free-inference-and-sums-of-log-normal-variates/blob/main/algorithms.py): `algorithms.py`
- [MCMC-ABC](https://github.com/rousenghak/monte-carlo---likelihood-free-inference-and-sums-of-log-normal-variates/blob/main/algorithms.py): `algorithms.py`
- [Reject-ABC study](https://github.com/rousenghak/monte-carlo---likelihood-free-inference-and-sums-of-log-normal-variates/blob/main/Reject_ABC.ipynb): `Reject_ABC.ipynb`
- [MCMC-ABC study](https://github.com/rousenghak/monte-carlo---likelihood-free-inference-and-sums-of-log-normal-variates/blob/main/MCMC_ABC_optimizedv3.ipynb): `MCMC_ABC_optimizedv3.ipynb`
- [MCMC base functions](https://github.com/rousenghak/monte-carlo---likelihood-free-inference-and-sums-of-log-normal-variates/blob/main/MCMC_ABCv2.py): `MCMC_ABCv2.py`
- [ABC algorithms](https://github.com/rousenghak/monte-carlo---likelihood-free-inference-and-sums-of-log-normal-variates/blob/main/algorithms.py): `algorithms.py`

### Method evaluation

- [ABC benchmark](https://github.com/rousenghak/monte-carlo---likelihood-free-inference-and-sums-of-log-normal-variates/blob/main/benchmark2.py): `benchmark2.py`
- [Benchmark results](https://github.com/rousenghak/monte-carlo---likelihood-free-inference-and-sums-of-log-normal-variates/blob/main/benchmark_results/benchmark_results.csv): `benchmark_results/benchmark_results.csv`
- [Epsilon and Gibbs study](https://github.com/rousenghak/monte-carlo---likelihood-free-inference-and-sums-of-log-normal-variates/blob/main/estimating_espsilon_bias.py): `estimating_espsilon_bias.py`
- [Epsilon results](https://github.com/rousenghak/monte-carlo---likelihood-free-inference-and-sums-of-log-normal-variates/tree/main/epsilon_comparison): `epsilon_comparison`

### Results analysis

- **Posterior samples**
- [Epsilon plots](https://github.com/rousenghak/monte-carlo---likelihood-free-inference-and-sums-of-log-normal-variates/blob/main/plots_epsilon_bias.py): `plots_epsilon_bias.py`

### Other components

- **Researcher**

## Connections

- Researcher → Observed data: provides data
- Researcher → Reject-ABC study: runs study
- Researcher → MCMC-ABC study: runs study
- Reject-ABC study → Reject-ABC: documents use
- MCMC-ABC study → MCMC base functions: documents use
- Reject-ABC → Log-normal simulator: simulates proposals
- MCMC-ABC → Log-normal simulator: simulates proposals
- Observed data → Reject-ABC: compares against
- Observed data → MCMC-ABC: compares against
- Reject-ABC → Posterior samples: returns samples
- MCMC-ABC → Posterior samples: returns samples
- ABC benchmark → ABC algorithms: calls methods
- ABC benchmark → Benchmark results: writes results
- Epsilon and Gibbs study → Epsilon results: writes results
- Epsilon results → Epsilon plots: loads data
