# johnathanmartin1/time_series architecture

> Architecture diagram of the GitHub repository johnathanmartin1/time_series, 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/johnathanmartin1/time_series
- Repository: https://github.com/johnathanmartin1/time_series

## Overview

This repository is a Python time-series toolkit for correlation analysis, model construction, and fitting or forecasting AR/MA-family models. The principal workflow is to provide a sample, calculate ACF/PACF diagnostics and confidence bounds, then fit or construct a model and inspect forecasts. `time_series.py` re-exports several public functions and constructors. C++ extensions provide optional AVX-backed correlation calculations. The README is empty, and some source excerpts are partial; unsampled constructor and model behavior is represented only where the tree establishes its module path.

Main entry points: [`time_series.py`](https://github.com/johnathanmartin1/time_series/blob/master/time_series.py) (Time Series API), [`src/models/model_constructors`](https://github.com/johnathanmartin1/time_series/tree/master/src/models/model_constructors) (Model Constructors), [`src/pacf/pacf_function.py`](https://github.com/johnathanmartin1/time_series/blob/master/src/pacf/pacf_function.py) (PACF Functions), [`src/acf/acf_function.py`](https://github.com/johnathanmartin1/time_series/blob/master/src/acf/acf_function.py) (ACF Functions)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_api["Public API"]
  node_facade["Time Series API<br/>[time_series.py]"]
end

subgraph group_analysis["Correlation Analysis"]
  node_acf["ACF Functions<br/>[acf_function.py]"]
  node_pacf["PACF Functions<br/>[pacf_function.py]"]
  node_intervals["Confidence Bounds"]
end

subgraph group_models["Time Series Models"]
  node_ma_model["MA Fitting<br/>[MA_class.py]"]
  node_ar_model["AR Fitting<br/>[AR_class.py]"]
  node_arma_model["ARMA Fitting<br/>[ARMA_class.py]"]
  node_constructors["Model Constructors"]
  node_ar_constructor["AR Constructor"]
  node_ma_constructor["MA Constructor"]
  node_arma_constructor["ARMA Constructor"]
  node_stationarity["Stationarity Checks"]
end

subgraph group_backend["Numerical Backends"]
  node_acf_native["ACF C++ Backend"]
  node_pacf_native["PACF C++ Backend"]
end

node_user(("Analyst"))

node_user -->|"calls API"| node_facade
node_facade -->|"exports"| node_acf
node_facade -->|"exports"| node_pacf
node_facade -->|"exports"| node_ma_model
node_facade -->|"exports constructors"| node_constructors
node_pacf -->|"computes ACF"| node_acf
node_acf -->|"calculates natively"| node_acf_native
node_pacf -->|"calculates natively"| node_pacf_native
node_acf -->|"plots bounds"| node_intervals
node_pacf -->|"plots bounds"| node_intervals
node_user -->|"fits or forecasts"| node_ar_model
node_user -->|"fits or forecasts"| node_arma_model
node_user -->|"requests series"| node_constructors
node_constructors -->|"dispatches AR"| node_ar_constructor
node_constructors -->|"dispatches MA"| node_ma_constructor
node_constructors -->|"dispatches ARMA"| node_arma_constructor
node_arma_constructor -->|"checks parameters"| node_stationarity

click node_facade "https://github.com/johnathanmartin1/time_series/blob/master/time_series.py"
click node_acf "https://github.com/johnathanmartin1/time_series/blob/master/src/acf/acf_function.py"
click node_pacf "https://github.com/johnathanmartin1/time_series/blob/master/src/pacf/pacf_function.py"
click node_intervals "https://github.com/johnathanmartin1/time_series/blob/master/src/tools/confidence_interval.py"
click node_acf_native "https://github.com/johnathanmartin1/time_series/blob/master/src/acf/C%2B%2B_acf_backend/acf_cpp_backend.cpp"
click node_pacf_native "https://github.com/johnathanmartin1/time_series/blob/master/src/pacf/C%2B%2B_pacf_backend/pacf_cpp_backend.cpp"
click node_ma_model "https://github.com/johnathanmartin1/time_series/blob/master/src/models/moving_average_model/MA_class.py"
click node_ar_model "https://github.com/johnathanmartin1/time_series/blob/master/src/models/auto_regressive_model/AR_class.py"
click node_arma_model "https://github.com/johnathanmartin1/time_series/blob/master/src/models/auto_regressive_moving_average_model/ARMA_class.py"
click node_constructors "https://github.com/johnathanmartin1/time_series/tree/master/src/models/model_constructors"
click node_ar_constructor "https://github.com/johnathanmartin1/time_series/blob/master/src/models/model_constructors/AR_model_constructor.py"
click node_ma_constructor "https://github.com/johnathanmartin1/time_series/blob/master/src/models/model_constructors/MA_model_constructor.py"
click node_arma_constructor "https://github.com/johnathanmartin1/time_series/blob/master/src/models/model_constructors/ARMA_model_constructor.py"
click node_stationarity "https://github.com/johnathanmartin1/time_series/blob/master/src/models/model_constructors/stationality_functions.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_facade toneBlue
class node_acf,node_pacf,node_intervals toneAmber
class node_ma_model,node_ar_model,node_arma_model,node_constructors,node_ar_constructor,node_ma_constructor,node_arma_constructor,node_stationarity toneMint
class node_acf_native,node_pacf_native toneRose
class node_user toneIndigo
```

## Components

### Public API

- [Time Series API](https://github.com/johnathanmartin1/time_series/blob/master/time_series.py): `time_series.py`

### Correlation Analysis

- [ACF Functions](https://github.com/johnathanmartin1/time_series/blob/master/src/acf/acf_function.py): `src/acf/acf_function.py`
- [PACF Functions](https://github.com/johnathanmartin1/time_series/blob/master/src/pacf/pacf_function.py): `src/pacf/pacf_function.py`
- [Confidence Bounds](https://github.com/johnathanmartin1/time_series/blob/master/src/tools/confidence_interval.py): `src/tools/confidence_interval.py`

### Time Series Models

- [MA Fitting](https://github.com/johnathanmartin1/time_series/blob/master/src/models/moving_average_model/MA_class.py): `src/models/moving_average_model/MA_class.py`
- [AR Fitting](https://github.com/johnathanmartin1/time_series/blob/master/src/models/auto_regressive_model/AR_class.py): `src/models/auto_regressive_model/AR_class.py`
- [ARMA Fitting](https://github.com/johnathanmartin1/time_series/blob/master/src/models/auto_regressive_moving_average_model/ARMA_class.py): `src/models/auto_regressive_moving_average_model/ARMA_class.py`
- [Model Constructors](https://github.com/johnathanmartin1/time_series/tree/master/src/models/model_constructors): `src/models/model_constructors`
- [AR Constructor](https://github.com/johnathanmartin1/time_series/blob/master/src/models/model_constructors/AR_model_constructor.py): `src/models/model_constructors/AR_model_constructor.py`
- [MA Constructor](https://github.com/johnathanmartin1/time_series/blob/master/src/models/model_constructors/MA_model_constructor.py): `src/models/model_constructors/MA_model_constructor.py`
- [ARMA Constructor](https://github.com/johnathanmartin1/time_series/blob/master/src/models/model_constructors/ARMA_model_constructor.py): `src/models/model_constructors/ARMA_model_constructor.py`
- [Stationarity Checks](https://github.com/johnathanmartin1/time_series/blob/master/src/models/model_constructors/stationality_functions.py): `src/models/model_constructors/stationality_functions.py`

### Numerical Backends

- [ACF C++ Backend](https://github.com/johnathanmartin1/time_series/blob/master/src/acf/C%2B%2B_acf_backend/acf_cpp_backend.cpp): `src/acf/C++_acf_backend/acf_cpp_backend.cpp`
- [PACF C++ Backend](https://github.com/johnathanmartin1/time_series/blob/master/src/pacf/C%2B%2B_pacf_backend/pacf_cpp_backend.cpp): `src/pacf/C++_pacf_backend/pacf_cpp_backend.cpp`

### Other components

- **Analyst**

## Connections

- Analyst → Time Series API: calls API
- Time Series API → ACF Functions: exports
- Time Series API → PACF Functions: exports
- Time Series API → MA Fitting: exports
- Time Series API → Model Constructors: exports constructors
- PACF Functions → ACF Functions: computes ACF
- ACF Functions → ACF C++ Backend: calculates natively
- PACF Functions → PACF C++ Backend: calculates natively
- ACF Functions → Confidence Bounds: plots bounds
- PACF Functions → Confidence Bounds: plots bounds
- Analyst → AR Fitting: fits or forecasts
- Analyst → ARMA Fitting: fits or forecasts
- Analyst → Model Constructors: requests series
- Model Constructors → AR Constructor: dispatches AR
- Model Constructors → MA Constructor: dispatches MA
- Model Constructors → ARMA Constructor: dispatches ARMA
- ARMA Constructor → Stationarity Checks: checks parameters
