# minireference/ministats architecture

> Architecture diagram of the GitHub repository minireference/ministats, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2024-12-27). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/minireference/ministats
- Repository: https://github.com/minireference/ministats

## Overview

##### Main Components Organization

a. Core Statistical Components:
- Main statistical modules (bayes.py, confidence_intervals.py, hypothesis_tests.py, etc.)
- By functionality (inference, modeling, probability)

b. Plotting Components:
- Plots package structure
- Three main plotting categories (probability, regression, figures)

c. Utility Components:
- Support modules (utils.py, formulas.py)
- Testing infrastructure

##### Component Relationships
Use the following structure:

**[Core Statistical Components]**
- Probability (probs.py)
- Inference
- Confidence Intervals
- Hypothesis Tests
- Estimators
- Modeling
- Linear Models
- Bayesian Analysis
- Simulations

**[Plotting Components]**
- Probability Visualizations
- Regression Plots
- Book Figures

**[Support Infrastructure]**
- Utils
- Formulas
- Testing Framework

##### External Dependencies
- A section showing integration with scipy.stats
- Testing framework dependencies

##### Special Notes
- A note about the intentionally simple implementation for educational purposes
- Separation between public API and internal implementation
- Which components are used for the book figures vs. general usage

##### Implementation Details
- Modules that are complete vs. in progress (based on the roadmap)
- Relationship between test files and their corresponding implementation files
- Which components are part of the public API

## Diagram (Mermaid)

```mermaid
graph TB
    subgraph Core["Core Statistical Components"]
        direction TB
        Prob["Probability"]:::core
        click Prob "https://github.com/minireference/ministats/blob/main/ministats/probs.py"
        
        subgraph Inference["Inference"]
            direction TB
            CI["Confidence Intervals"]:::core
            click CI "https://github.com/minireference/ministats/blob/main/ministats/confidence_intervals.py"
            HT["Hypothesis Tests"]:::core
            click HT "https://github.com/minireference/ministats/blob/main/ministats/hypothesis_tests.py"
            EST["Estimators"]:::core
            click EST "https://github.com/minireference/ministats/blob/main/ministats/estimators.py"
        end
        
        subgraph Modeling["Modeling"]
            direction TB
            LM["Linear Models"]:::core
            click LM "https://github.com/minireference/ministats/blob/main/ministats/linear_models.py"
            BA["Bayesian Analysis"]:::core
            click BA "https://github.com/minireference/ministats/blob/main/ministats/bayes.py"
        end
        
        SIM["Simulations"]:::core
        click SIM "https://github.com/minireference/ministats/blob/main/ministats/simulations.py"
        SAMP["Sampling"]:::core
        click SAMP "https://github.com/minireference/ministats/blob/main/ministats/sampling.py"
    end
    
    subgraph Plots["Plotting Components"]
        direction TB
        ProbViz["Probability Visualizations"]:::plot
        click ProbViz "https://github.com/minireference/ministats/blob/main/ministats/plots/probability.py"
        RegPlot["Regression Plots"]:::plot
        click RegPlot "https://github.com/minireference/ministats/blob/main/ministats/plots/regression.py"
        BookFig["Book Figures"]:::plot
        click BookFig "https://github.com/minireference/ministats/blob/main/ministats/plots/figures.py"
    end
    
    subgraph Support["Support Infrastructure"]
        direction TB
        Utils["Utilities"]:::support
        click Utils "https://github.com/minireference/ministats/blob/main/ministats/utils.py"
        Forms["Formulas"]:::support
        click Forms "https://github.com/minireference/ministats/blob/main/ministats/formulas.py"
        Tests["Testing Framework"]:::support
        click Tests "https://github.com/minireference/ministats/tree/main/tests/"
    end
    
    subgraph Docs["Documentation"]
        direction TB
        Design["Design Docs"]:::doc
        click Design "https://github.com/minireference/ministats/blob/main/docs/design.md"
        Usage["Usage Guide"]:::doc
        click Usage "https://github.com/minireference/ministats/blob/main/docs/usage.rst"
        Install["Installation Guide"]:::doc
        click Install "https://github.com/minireference/ministats/blob/main/docs/installation.rst"
    end
    
    CICD["CI/CD Pipeline"]:::infra
    click CICD "https://github.com/minireference/ministats/blob/main/.github/workflows/pytests.yml"
    
    %% Core Dependencies
    Prob --> CI
    Prob --> HT
    Prob --> EST
    CI --> LM
    HT --> LM
    EST --> BA
    SAMP --> SIM
    
    %% Plotting Dependencies
    LM --> RegPlot
    Prob --> ProbViz
    BA --> BookFig
    LM --> BookFig
    
    %% Support Dependencies
    Utils --> Core
    Forms --> Core
    Tests --> Core
    
    %% Documentation Dependencies
    Core --> Docs
    Plots --> Docs
    
    %% Infrastructure
    Tests --> CICD
    
    classDef core fill:#2374ab,stroke:#2374ab,color:white
    classDef plot fill:#57a773,stroke:#57a773,color:white
    classDef support fill:#808080,stroke:#808080,color:white
    classDef doc fill:#ffa07a,stroke:#ffa07a,color:white
    classDef infra fill:#6c757d,stroke:#6c757d,color:white
    
    %% Legend
    subgraph Legend
        L1["Core Statistical"]:::core
        L2["Plotting"]:::plot
        L3["Support"]:::support
        L4["Documentation"]:::doc
        L5["Infrastructure"]:::infra
    end
```
