# bayes-works/openbdlm architecture

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

- Interactive diagram: https://gitdiagram.com/bayes-works/openbdlm
- Repository: https://github.com/bayes-works/openbdlm

## Overview

OpenBDLM is a MATLAB application for Bayesian dynamic linear model analysis of time series. Users start it interactively, with a configuration file, or in batch mode; the documented workflow initializes a project, builds a model, estimates hidden states, and can visualize and save results. The README also describes anomaly detection and handling missing or irregularly spaced data. Source excerpts were unavailable, so subsystem links below reflect documented capabilities and file roles, not inspected implementation calls.

Main entry points: [`OpenBDLM_main.m`](https://github.com/bayes-works/openbdlm/blob/master/OpenBDLM_main.m) (Main menu), [`functions/DataLoader`](https://github.com/bayes-works/openbdlm/tree/master/functions/DataLoader) (Data loading), [`config_files`](https://github.com/bayes-works/openbdlm/tree/master/config_files) (Configuration), [`functions/ModelConfiguration`](https://github.com/bayes-works/openbdlm/tree/master/functions/ModelConfiguration) (Model building)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_entry["Project entry"]
  node_main["Main menu<br/>[OpenBDLM_main.m]"]
  node_config["Configuration"]
end

subgraph group_analysis["Model analysis"]
  node_model["Model building"]
  node_estimation["State estimation"]
  node_learning["Parameter learning"]
  node_anomaly["Anomaly detection"]
end

subgraph group_io["Project data"]
  node_loader["Data loading"]
  node_datafiles[("Time-series files")]
end

subgraph group_outputs["Results and views"]
  node_visualization["Plots"]
  node_projects[("Saved projects")]
  node_results[("Analysis results")]
  node_logs["Run logs"]
end

node_user(("User"))

node_user -->|"starts analysis"| node_main
node_main -->|"loads configuration"| node_config
node_main -->|"loads data"| node_loader
node_loader -->|"reads time series"| node_datafiles
node_main -->|"builds model"| node_model
node_main -->|"computes states"| node_estimation
node_main -.->|"learns parameters"| node_learning
node_main -.->|"detects anomalies"| node_anomaly
node_main -->|"plots analysis"| node_visualization
node_main -->|"saves project"| node_projects
node_main -->|"saves results"| node_results
node_main -->|"records run"| node_logs

click node_main "https://github.com/bayes-works/openbdlm/blob/master/OpenBDLM_main.m"
click node_config "https://github.com/bayes-works/openbdlm/tree/master/config_files"
click node_loader "https://github.com/bayes-works/openbdlm/tree/master/functions/DataLoader"
click node_datafiles "https://github.com/bayes-works/openbdlm/tree/master/data"
click node_model "https://github.com/bayes-works/openbdlm/tree/master/functions/ModelConfiguration"
click node_estimation "https://github.com/bayes-works/openbdlm/tree/master/functions/StateEstimation"
click node_learning "https://github.com/bayes-works/openbdlm/tree/master/functions/ModelParametersLearning"
click node_anomaly "https://github.com/bayes-works/openbdlm/tree/master/functions/StateEstimation"
click node_visualization "https://github.com/bayes-works/openbdlm/tree/master/functions/VisualizationTools"
click node_projects "https://github.com/bayes-works/openbdlm/tree/master/saved_projects"
click node_results "https://github.com/bayes-works/openbdlm/tree/master/results"
click node_logs "https://github.com/bayes-works/openbdlm/tree/master/log_files"

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_main,node_config,node_user toneBlue
class node_model,node_estimation,node_learning,node_anomaly toneAmber
class node_loader,node_datafiles toneMint
class node_visualization,node_projects,node_results,node_logs toneRose
```

## Components

### Project entry

- [Main menu](https://github.com/bayes-works/openbdlm/blob/master/OpenBDLM_main.m): `OpenBDLM_main.m`
- [Configuration](https://github.com/bayes-works/openbdlm/tree/master/config_files): `config_files`

### Model analysis

- [Model building](https://github.com/bayes-works/openbdlm/tree/master/functions/ModelConfiguration): `functions/ModelConfiguration`
- [State estimation](https://github.com/bayes-works/openbdlm/tree/master/functions/StateEstimation): `functions/StateEstimation`
- [Parameter learning](https://github.com/bayes-works/openbdlm/tree/master/functions/ModelParametersLearning): `functions/ModelParametersLearning`
- [Anomaly detection](https://github.com/bayes-works/openbdlm/tree/master/functions/StateEstimation): `functions/StateEstimation`

### Project data

- [Data loading](https://github.com/bayes-works/openbdlm/tree/master/functions/DataLoader): `functions/DataLoader`
- [Time-series files](https://github.com/bayes-works/openbdlm/tree/master/data): `data`

### Results and views

- [Plots](https://github.com/bayes-works/openbdlm/tree/master/functions/VisualizationTools): `functions/VisualizationTools`
- [Saved projects](https://github.com/bayes-works/openbdlm/tree/master/saved_projects): `saved_projects`
- [Analysis results](https://github.com/bayes-works/openbdlm/tree/master/results): `results`
- [Run logs](https://github.com/bayes-works/openbdlm/tree/master/log_files): `log_files`

### Other components

- **User**

## Connections

- User → Main menu: starts analysis (evidence: `README.md`)
- Main menu → Configuration: loads configuration (evidence: `README.md`)
- Main menu → Data loading: loads data (evidence: `README.md`)
- Data loading → Time-series files: reads time series (evidence: `README.md`)
- Main menu → Model building: builds model (evidence: `README.md`)
- Main menu → State estimation: computes states (evidence: `README.md`)
- Main menu → Parameter learning: learns parameters
- Main menu → Anomaly detection: detects anomalies
- Main menu → Plots: plots analysis (evidence: `README.md`)
- Main menu → Saved projects: saves project (evidence: `README.md`)
- Main menu → Analysis results: saves results (evidence: `README.md`)
- Main menu → Run logs: records run (evidence: `README.md`)
