# bartbussmann/navar architecture

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

- Interactive diagram: https://gitdiagram.com/bartbussmann/navar
- Repository: https://github.com/bartbussmann/navar

## Overview

NAVAR is a time-series causal-discovery tool: users provide multivariate data, the code prepares lagged inputs, trains an additive neural autoregression, and returns a matrix of candidate causal-link scores. DREAM3 runs can optionally compare scores with ground truth; CauseMe runs save score matrices for platform evaluation. The core training, model, loader, and evaluation files are excerpted; experiment-runner excerpts show their orchestration and data handling.

Main entry points: [`train_NAVAR.py`](https://github.com/bartbussmann/navar/blob/master/train_NAVAR.py) (NAVAR training), [`run_dream_experiments.py`](https://github.com/bartbussmann/navar/blob/master/run_dream_experiments.py) (DREAM3 experiments), [`run_causeme_experiments.py`](https://github.com/bartbussmann/navar/blob/master/run_causeme_experiments.py) (CauseMe experiments), [`run_NAVAR.py`](https://github.com/bartbussmann/navar/blob/master/run_NAVAR.py) (Custom data run)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_entry["Experiment entry points"]
  node_custom_run["Custom data run<br/>[run_NAVAR.py]"]
  node_dream_run["DREAM3 experiments"]
  node_causeme_run["CauseMe experiments"]
end

subgraph group_core["Model and training"]
  node_training["NAVAR training<br/>[train_NAVAR.py]"]
  node_mlp["NAVAR model<br/>[NAVAR.py]"]
end

subgraph group_data["Data preparation"]
  node_loader["Lagged data loader<br/>[dataloader.py]"]
end

subgraph group_analysis["Scoring and evaluation"]
  node_scores["Causal score matrix<br/>[train_NAVAR.py]"]
  node_dream_eval["DREAM3 evaluation<br/>[evaluate.py]"]
  node_causeme_results["Saved score results"]
end

node_researcher(("Researcher"))
node_input_data["Time-series data"]
node_experiment_data["Experiment datasets"]
node_causeme_platform(("CauseMe platform"))

node_researcher -->|"runs"| node_custom_run
node_custom_run -->|"reads CSV"| node_input_data
node_custom_run -->|"trains model"| node_training
node_researcher -->|"runs"| node_dream_run
node_dream_run -->|"reads datasets"| node_experiment_data
node_dream_run -->|"trains model"| node_training
node_dream_run -->|"evaluates scores"| node_dream_eval
node_researcher -->|"runs"| node_causeme_run
node_causeme_run -->|"reads archives"| node_experiment_data
node_causeme_run -->|"trains model"| node_training
node_causeme_run -->|"writes scores"| node_causeme_results
node_causeme_results -->|"evaluated by"| node_causeme_platform
node_training -->|"prepares batches"| node_loader
node_training -->|"calls model"| node_mlp
node_training -->|"derives scores"| node_scores
node_dream_eval -->|"compares scores"| node_scores

click node_custom_run "https://github.com/bartbussmann/navar/blob/master/run_NAVAR.py"
click node_dream_run "https://github.com/bartbussmann/navar/blob/master/run_dream_experiments.py"
click node_causeme_run "https://github.com/bartbussmann/navar/blob/master/run_causeme_experiments.py"
click node_experiment_data "https://github.com/bartbussmann/navar/tree/master/experiments"
click node_training "https://github.com/bartbussmann/navar/blob/master/train_NAVAR.py"
click node_mlp "https://github.com/bartbussmann/navar/blob/master/NAVAR.py"
click node_loader "https://github.com/bartbussmann/navar/blob/master/dataloader.py"
click node_scores "https://github.com/bartbussmann/navar/blob/master/train_NAVAR.py"
click node_dream_eval "https://github.com/bartbussmann/navar/blob/master/evaluate.py"
click node_causeme_results "https://github.com/bartbussmann/navar/blob/master/run_causeme_experiments.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_custom_run,node_dream_run,node_causeme_run toneBlue
class node_training,node_mlp toneAmber
class node_loader toneMint
class node_scores,node_dream_eval,node_causeme_results toneRose
class node_researcher,node_input_data,node_causeme_platform toneIndigo
class node_experiment_data toneTeal
```

## Components

### Experiment entry points

- [Custom data run](https://github.com/bartbussmann/navar/blob/master/run_NAVAR.py): `run_NAVAR.py`
- [DREAM3 experiments](https://github.com/bartbussmann/navar/blob/master/run_dream_experiments.py): `run_dream_experiments.py`
- [CauseMe experiments](https://github.com/bartbussmann/navar/blob/master/run_causeme_experiments.py): `run_causeme_experiments.py`

### Model and training

- [NAVAR training](https://github.com/bartbussmann/navar/blob/master/train_NAVAR.py): `train_NAVAR.py`
- [NAVAR model](https://github.com/bartbussmann/navar/blob/master/NAVAR.py): `NAVAR.py`

### Data preparation

- [Lagged data loader](https://github.com/bartbussmann/navar/blob/master/dataloader.py): `dataloader.py`

### Scoring and evaluation

- [Causal score matrix](https://github.com/bartbussmann/navar/blob/master/train_NAVAR.py): `train_NAVAR.py`
- [DREAM3 evaluation](https://github.com/bartbussmann/navar/blob/master/evaluate.py): `evaluate.py`
- [Saved score results](https://github.com/bartbussmann/navar/blob/master/run_causeme_experiments.py): `run_causeme_experiments.py`

### Other components

- **Researcher**
- **Time-series data**
- [Experiment datasets](https://github.com/bartbussmann/navar/tree/master/experiments): `experiments`
- **CauseMe platform**

## Connections

- Researcher → Custom data run: runs (evidence: `README.md`)
- Custom data run → Time-series data: reads CSV (evidence: `run_NAVAR.py`)
- Custom data run → NAVAR training: trains model (evidence: `run_NAVAR.py`)
- Researcher → DREAM3 experiments: runs (evidence: `README.md`)
- DREAM3 experiments → Experiment datasets: reads datasets (evidence: `run_dream_experiments.py`)
- DREAM3 experiments → NAVAR training: trains model (evidence: `run_dream_experiments.py`)
- DREAM3 experiments → DREAM3 evaluation: evaluates scores (evidence: `run_dream_experiments.py`)
- Researcher → CauseMe experiments: runs (evidence: `README.md`)
- CauseMe experiments → Experiment datasets: reads archives (evidence: `run_causeme_experiments.py`)
- CauseMe experiments → NAVAR training: trains model (evidence: `run_causeme_experiments.py`)
- CauseMe experiments → Saved score results: writes scores (evidence: `run_causeme_experiments.py`)
- Saved score results → CauseMe platform: evaluated by (evidence: `README.md`)
- NAVAR training → Lagged data loader: prepares batches (evidence: `train_NAVAR.py`)
- NAVAR training → NAVAR model: calls model (evidence: `train_NAVAR.py`)
- NAVAR training → Causal score matrix: derives scores (evidence: `train_NAVAR.py`)
- DREAM3 evaluation → Causal score matrix: compares scores (evidence: `run_dream_experiments.py`)
