# weecology/everglades-forecasting architecture

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

- Interactive diagram: https://gitdiagram.com/weecology/everglades-forecasting
- Repository: https://github.com/weecology/everglades-forecasting

## Overview

This repository forecasts Everglades wading-bird populations by preparing configured species and spatial data, fitting selected models across sliding time windows, and evaluating numeric and ordinal forecast skill. It also documents forecast visualizations and a latest-year forecast-versus-actual view. The README supports the main workflow and model/evaluation relationships; source excerpts were unavailable, so uncertain implementation wiring and peripheral scripts are omitted.

Main entry points: [`evaluation.R`](https://github.com/weecology/everglades-forecasting/blob/main/evaluation.R) (Sliding-window evaluation), [`main.R`](https://github.com/weecology/everglades-forecasting/blob/main/main.R) (Pipeline runner), [`config.yml`](https://github.com/weecology/everglades-forecasting/blob/main/config.yml) (Run configuration), [`data_functions.R`](https://github.com/weecology/everglades-forecasting/blob/main/data_functions.R) (Data preparation)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_workflow["Forecast workflow"]
  node_config["Run configuration<br/>[config.yml]"]
  node_main["Pipeline runner<br/>[main.R]"]
  node_data["Data preparation<br/>[data_functions.R]"]
end

subgraph group_mvgam["Dynamic GAM models"]
  node_mvgam_baseline["Long-term baseline<br/>[mvgam_baseline.R]"]
  node_mvgam_ar["AR smooth covariates<br/>[mvgam_ar.R]"]
  node_mvgam_ar_exog["AR linear covariates<br/>[mvgam_ar_exog.R]"]
  node_mvgam_ar_exog_plus["AR interactions"]
  node_mvgam_species["Species-specific effects"]
  node_mvgam_trait["Trait-weighted effects<br/>[mvgam_trait.R]"]
  node_mvgam_trait2["Trait and guild effects<br/>[mvgam_trait2.R]"]
end

subgraph group_fable["Time-series models"]
  node_fable_models["Fable model set<br/>[fable_models.R]"]
end

subgraph group_assessment["Evaluation and outputs"]
  node_evaluation["Sliding-window evaluation<br/>[evaluation.R]"]
  node_plotting["Skill visualizations<br/>[plotting.R]"]
  node_final_plots["Latest-year plots<br/>[final_year_plots.R]"]
end

node_analyst(("Forecast user"))

node_analyst -->|"starts run"| node_main
node_main -->|"reads settings"| node_config
node_main -->|"prepares data"| node_data
node_main -->|"runs windows"| node_evaluation
node_evaluation -->|"fits selected"| node_mvgam_baseline
node_evaluation -->|"fits selected"| node_mvgam_ar
node_evaluation -->|"fits selected"| node_mvgam_ar_exog
node_evaluation -->|"fits selected"| node_mvgam_ar_exog_plus
node_evaluation -->|"fits selected"| node_mvgam_species
node_evaluation -->|"fits selected"| node_mvgam_trait
node_evaluation -->|"fits selected"| node_mvgam_trait2
node_evaluation -->|"fits selected"| node_fable_models
node_evaluation -->|"summarizes skill"| node_plotting
node_main -->|"generates forecasts"| node_final_plots

click node_config "https://github.com/weecology/everglades-forecasting/blob/main/config.yml"
click node_main "https://github.com/weecology/everglades-forecasting/blob/main/main.R"
click node_data "https://github.com/weecology/everglades-forecasting/blob/main/data_functions.R"
click node_evaluation "https://github.com/weecology/everglades-forecasting/blob/main/evaluation.R"
click node_mvgam_baseline "https://github.com/weecology/everglades-forecasting/blob/main/models/mvgam_baseline.R"
click node_mvgam_ar "https://github.com/weecology/everglades-forecasting/blob/main/models/mvgam_ar.R"
click node_mvgam_ar_exog "https://github.com/weecology/everglades-forecasting/blob/main/models/mvgam_ar_exog.R"
click node_mvgam_ar_exog_plus "https://github.com/weecology/everglades-forecasting/blob/main/models/mvgam_ar_exog_plus.R"
click node_mvgam_species "https://github.com/weecology/everglades-forecasting/blob/main/models/mvgam_species_specific.R"
click node_mvgam_trait "https://github.com/weecology/everglades-forecasting/blob/main/models/mvgam_trait.R"
click node_mvgam_trait2 "https://github.com/weecology/everglades-forecasting/blob/main/models/mvgam_trait2.R"
click node_fable_models "https://github.com/weecology/everglades-forecasting/blob/main/models/fable_models.R"
click node_plotting "https://github.com/weecology/everglades-forecasting/blob/main/plotting.R"
click node_final_plots "https://github.com/weecology/everglades-forecasting/blob/main/final_year_plots.R"

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_config,node_main,node_data,node_analyst toneBlue
class node_mvgam_baseline,node_mvgam_ar,node_mvgam_ar_exog,node_mvgam_ar_exog_plus,node_mvgam_species,node_mvgam_trait,node_mvgam_trait2 toneAmber
class node_fable_models toneMint
class node_evaluation,node_plotting,node_final_plots toneRose
```

## Components

### Forecast workflow

- [Run configuration](https://github.com/weecology/everglades-forecasting/blob/main/config.yml): `config.yml`
- [Pipeline runner](https://github.com/weecology/everglades-forecasting/blob/main/main.R): `main.R`
- [Data preparation](https://github.com/weecology/everglades-forecasting/blob/main/data_functions.R): `data_functions.R`

### Dynamic GAM models

- [Long-term baseline](https://github.com/weecology/everglades-forecasting/blob/main/models/mvgam_baseline.R): `models/mvgam_baseline.R`
- [AR smooth covariates](https://github.com/weecology/everglades-forecasting/blob/main/models/mvgam_ar.R): `models/mvgam_ar.R`
- [AR linear covariates](https://github.com/weecology/everglades-forecasting/blob/main/models/mvgam_ar_exog.R): `models/mvgam_ar_exog.R`
- [AR interactions](https://github.com/weecology/everglades-forecasting/blob/main/models/mvgam_ar_exog_plus.R): `models/mvgam_ar_exog_plus.R`
- [Species-specific effects](https://github.com/weecology/everglades-forecasting/blob/main/models/mvgam_species_specific.R): `models/mvgam_species_specific.R`
- [Trait-weighted effects](https://github.com/weecology/everglades-forecasting/blob/main/models/mvgam_trait.R): `models/mvgam_trait.R`
- [Trait and guild effects](https://github.com/weecology/everglades-forecasting/blob/main/models/mvgam_trait2.R): `models/mvgam_trait2.R`

### Time-series models

- [Fable model set](https://github.com/weecology/everglades-forecasting/blob/main/models/fable_models.R): `models/fable_models.R`

### Evaluation and outputs

- [Sliding-window evaluation](https://github.com/weecology/everglades-forecasting/blob/main/evaluation.R): `evaluation.R`
- [Skill visualizations](https://github.com/weecology/everglades-forecasting/blob/main/plotting.R): `plotting.R`
- [Latest-year plots](https://github.com/weecology/everglades-forecasting/blob/main/final_year_plots.R): `final_year_plots.R`

### Other components

- **Forecast user**

## Connections

- Forecast user → Pipeline runner: starts run
- Pipeline runner → Run configuration: reads settings
- Pipeline runner → Data preparation: prepares data
- Pipeline runner → Sliding-window evaluation: runs windows
- Sliding-window evaluation → Long-term baseline: fits selected
- Sliding-window evaluation → AR smooth covariates: fits selected
- Sliding-window evaluation → AR linear covariates: fits selected
- Sliding-window evaluation → AR interactions: fits selected
- Sliding-window evaluation → Species-specific effects: fits selected
- Sliding-window evaluation → Trait-weighted effects: fits selected
- Sliding-window evaluation → Trait and guild effects: fits selected
- Sliding-window evaluation → Fable model set: fits selected
- Sliding-window evaluation → Skill visualizations: summarizes skill
- Pipeline runner → Latest-year plots: generates forecasts
