# ozerbakar/forecasting-the-level-and-dispersion-of-mortality-a-deep-learning-approach architecture

> Architecture diagram of the GitHub repository ozerbakar/forecasting-the-level-and-dispersion-of-mortality-a-deep-learning-approach, 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/ozerbakar/forecasting-the-level-and-dispersion-of-mortality-a-deep-learning-approach
- Repository: https://github.com/ozerbakar/forecasting-the-level-and-dispersion-of-mortality-a-deep-learning-approach

## Overview

This is an R research replication package for comparing five neural and four stochastic mortality-forecasting approaches across national populations, sexes, and rolling forecast origins. The documented workflow rebuilds data from Human Mortality Database counts, validates inputs, fits both model families, scores forecasts for life expectancy and life disparity, and produces tables and figures. The README supports these workflow relationships; source excerpts were not provided, so internal call details beyond those documented are omitted.

Main entry points: [`run_all.R`](https://github.com/ozerbakar/forecasting-the-level-and-dispersion-of-mortality-a-deep-learning-approach/blob/main/run_all.R) (Analysis driver), [`R/40_scoring.R`](https://github.com/ozerbakar/forecasting-the-level-and-dispersion-of-mortality-a-deep-learning-approach/blob/main/R/40_scoring.R) (Forecast scoring), [`run_figures.R`](https://github.com/ozerbakar/forecasting-the-level-and-dispersion-of-mortality-a-deep-learning-approach/blob/main/run_figures.R) (Final figure driver), [`run_reproduce.R`](https://github.com/ozerbakar/forecasting-the-level-and-dispersion-of-mortality-a-deep-learning-approach/blob/main/run_reproduce.R) (Reproduce driver)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_workflow["Replication workflow"]
  node_reproduce["Reproduce driver<br/>[run_reproduce.R]"]
  node_all["Analysis driver<br/>[run_all.R]"]
  node_data["Data preparation<br/>[10_data.R]"]
  node_validation["Model validation"]
end

subgraph group_models["Forecast models"]
  node_stochastic["Stochastic models<br/>[20_stochastic.R]"]
  node_neural["Neural models<br/>[30_neural.R]"]
  node_engine["Neural engine<br/>[neural_engine_v7.R]"]
end

subgraph group_evaluation["Evaluation outputs"]
  node_scoring["Forecast scoring<br/>[40_scoring.R]"]
  node_tables["Result tables<br/>[50_tables.R]"]
  node_extra_tables["Supplementary tables<br/>[51_tables_extra.R]"]
  node_results["Analysis results"]
end

subgraph group_presentation["Figures"]
  node_pipeline_figures["Pipeline figures<br/>[60_figures.R]"]
  node_figure_driver["Final figure driver<br/>[run_figures.R]"]
  node_standalone_figures["Article figures"]
end

node_researcher(("Researcher"))
node_hmd[("HMD counts")]

node_researcher -->|"runs"| node_reproduce
node_reproduce -->|"rebuilds analysis"| node_all
node_hmd -->|"provides counts"| node_data
node_all -->|"runs stage"| node_data
node_all -->|"runs stage"| node_validation
node_all -->|"runs stage"| node_stochastic
node_all -->|"runs stage"| node_neural
node_all -->|"runs stage"| node_scoring
node_all -->|"runs stage"| node_pipeline_figures
node_neural -->|"sources and extends"| node_engine
node_scoring -->|"produces"| node_tables
node_scoring -.->|"produces"| node_extra_tables
node_all -->|"creates outputs"| node_results
node_figure_driver -->|"creates figures"| node_standalone_figures
node_results -->|"supplies tables"| node_figure_driver
node_researcher -->|"runs"| node_figure_driver

click node_reproduce "https://github.com/ozerbakar/forecasting-the-level-and-dispersion-of-mortality-a-deep-learning-approach/blob/main/run_reproduce.R"
click node_all "https://github.com/ozerbakar/forecasting-the-level-and-dispersion-of-mortality-a-deep-learning-approach/blob/main/run_all.R"
click node_data "https://github.com/ozerbakar/forecasting-the-level-and-dispersion-of-mortality-a-deep-learning-approach/blob/main/R/10_data.R"
click node_validation "https://github.com/ozerbakar/forecasting-the-level-and-dispersion-of-mortality-a-deep-learning-approach/blob/main/R/12_edagger_validation.R"
click node_stochastic "https://github.com/ozerbakar/forecasting-the-level-and-dispersion-of-mortality-a-deep-learning-approach/blob/main/R/20_stochastic.R"
click node_neural "https://github.com/ozerbakar/forecasting-the-level-and-dispersion-of-mortality-a-deep-learning-approach/blob/main/R/30_neural.R"
click node_engine "https://github.com/ozerbakar/forecasting-the-level-and-dispersion-of-mortality-a-deep-learning-approach/blob/main/engine/neural_engine_v7.R"
click node_scoring "https://github.com/ozerbakar/forecasting-the-level-and-dispersion-of-mortality-a-deep-learning-approach/blob/main/R/40_scoring.R"
click node_tables "https://github.com/ozerbakar/forecasting-the-level-and-dispersion-of-mortality-a-deep-learning-approach/blob/main/R/50_tables.R"
click node_extra_tables "https://github.com/ozerbakar/forecasting-the-level-and-dispersion-of-mortality-a-deep-learning-approach/blob/main/R/51_tables_extra.R"
click node_pipeline_figures "https://github.com/ozerbakar/forecasting-the-level-and-dispersion-of-mortality-a-deep-learning-approach/blob/main/R/60_figures.R"
click node_figure_driver "https://github.com/ozerbakar/forecasting-the-level-and-dispersion-of-mortality-a-deep-learning-approach/blob/main/run_figures.R"
click node_standalone_figures "https://github.com/ozerbakar/forecasting-the-level-and-dispersion-of-mortality-a-deep-learning-approach/tree/main/figures"

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_reproduce,node_all,node_data,node_validation toneBlue
class node_stochastic,node_neural,node_engine,node_hmd toneAmber
class node_scoring,node_tables,node_extra_tables,node_results toneMint
class node_pipeline_figures,node_figure_driver,node_standalone_figures toneRose
class node_researcher toneIndigo
```

## Components

### Replication workflow

- [Reproduce driver](https://github.com/ozerbakar/forecasting-the-level-and-dispersion-of-mortality-a-deep-learning-approach/blob/main/run_reproduce.R): `run_reproduce.R`
- [Analysis driver](https://github.com/ozerbakar/forecasting-the-level-and-dispersion-of-mortality-a-deep-learning-approach/blob/main/run_all.R): `run_all.R`
- [Data preparation](https://github.com/ozerbakar/forecasting-the-level-and-dispersion-of-mortality-a-deep-learning-approach/blob/main/R/10_data.R): `R/10_data.R`
- [Model validation](https://github.com/ozerbakar/forecasting-the-level-and-dispersion-of-mortality-a-deep-learning-approach/blob/main/R/12_edagger_validation.R): `R/12_edagger_validation.R`

### Forecast models

- [Stochastic models](https://github.com/ozerbakar/forecasting-the-level-and-dispersion-of-mortality-a-deep-learning-approach/blob/main/R/20_stochastic.R): `R/20_stochastic.R`
- [Neural models](https://github.com/ozerbakar/forecasting-the-level-and-dispersion-of-mortality-a-deep-learning-approach/blob/main/R/30_neural.R): `R/30_neural.R`
- [Neural engine](https://github.com/ozerbakar/forecasting-the-level-and-dispersion-of-mortality-a-deep-learning-approach/blob/main/engine/neural_engine_v7.R): `engine/neural_engine_v7.R`

### Evaluation outputs

- [Forecast scoring](https://github.com/ozerbakar/forecasting-the-level-and-dispersion-of-mortality-a-deep-learning-approach/blob/main/R/40_scoring.R): `R/40_scoring.R`
- [Result tables](https://github.com/ozerbakar/forecasting-the-level-and-dispersion-of-mortality-a-deep-learning-approach/blob/main/R/50_tables.R): `R/50_tables.R`
- [Supplementary tables](https://github.com/ozerbakar/forecasting-the-level-and-dispersion-of-mortality-a-deep-learning-approach/blob/main/R/51_tables_extra.R): `R/51_tables_extra.R`
- **Analysis results**

### Figures

- [Pipeline figures](https://github.com/ozerbakar/forecasting-the-level-and-dispersion-of-mortality-a-deep-learning-approach/blob/main/R/60_figures.R): `R/60_figures.R`
- [Final figure driver](https://github.com/ozerbakar/forecasting-the-level-and-dispersion-of-mortality-a-deep-learning-approach/blob/main/run_figures.R): `run_figures.R`
- [Article figures](https://github.com/ozerbakar/forecasting-the-level-and-dispersion-of-mortality-a-deep-learning-approach/tree/main/figures): `figures`

### Other components

- **Researcher**
- **HMD counts**

## Connections

- Researcher → Reproduce driver: runs (evidence: `README.md`)
- Reproduce driver → Analysis driver: rebuilds analysis (evidence: `README.md`)
- HMD counts → Data preparation: provides counts (evidence: `README.md`)
- Analysis driver → Data preparation: runs stage (evidence: `README.md`)
- Analysis driver → Model validation: runs stage (evidence: `README.md`)
- Analysis driver → Stochastic models: runs stage (evidence: `README.md`)
- Analysis driver → Neural models: runs stage (evidence: `README.md`)
- Analysis driver → Forecast scoring: runs stage (evidence: `README.md`)
- Analysis driver → Pipeline figures: runs stage (evidence: `README.md`)
- Neural models → Neural engine: sources and extends (evidence: `README.md`)
- Forecast scoring → Result tables: produces (evidence: `README.md`)
- Forecast scoring → Supplementary tables: produces
- Analysis driver → Analysis results: creates outputs (evidence: `README.md`)
- Final figure driver → Article figures: creates figures (evidence: `README.md`)
- Analysis results → Final figure driver: supplies tables (evidence: `README.md`)
- Researcher → Final figure driver: runs (evidence: `README.md`)
