# apostolos00tapsas/interval-pca architecture

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

- Interactive diagram: https://gitdiagram.com/apostolos00tapsas/interval-pca
- Repository: https://github.com/apostolos00tapsas/interval-pca

## Overview

interval_pca is a Python library for interval arithmetic and three PCA formulations over interval-valued observations. Users provide lower and upper data bounds—optionally using the bundled Oil dataset—and fit IntervalPCA, MidpointRadiusPCA, or SymbolicPCA to obtain method-specific PCA results. IntervalPCA additionally computes optimized interval statistics and propagates interval bounds; the other methods use midpoint/radius or symbolic covariance formulations. The package also offers plotting helpers. Edges reflect README statements or source-index references; unsampled visualization wiring is left unclaimed.

Main entry points: [`interval_pca/interval_algebra.py`](https://github.com/apostolos00tapsas/interval-pca/blob/main/interval_pca/interval_algebra.py) (Interval arithmetic), [`interval_pca/ipca.py`](https://github.com/apostolos00tapsas/interval-pca/blob/main/interval_pca/ipca.py) (IntervalPCA), [`interval_pca/interval_stats.py`](https://github.com/apostolos00tapsas/interval-pca/blob/main/interval_pca/interval_stats.py) (Interval statistics), [`interval_pca/midrad_pca.py`](https://github.com/apostolos00tapsas/interval-pca/blob/main/interval_pca/midrad_pca.py) (Midpoint-radius PCA)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_foundation["Interval foundation"]
  node_intervals["Interval arithmetic"]
  node_interval_stats["Interval statistics<br/>[interval_stats.py]"]
end

subgraph group_analysis["PCA methods"]
  node_ipca["IntervalPCA<br/>[ipca.py]"]
  node_midrad["Midpoint-radius PCA<br/>[midrad_pca.py]"]
  node_symbolic["Symbolic PCA<br/>[symbolic_pca.py]"]
end

subgraph group_data["Data and plotting"]
  node_oil_data["Oil data<br/>[datasets.py]"]
  node_visualization["PCA plots<br/>[vis.py]"]
end

node_user(("Library user"))

node_user -->|"fits bounds"| node_ipca
node_user -->|"fits bounds"| node_midrad
node_user -->|"fits bounds"| node_symbolic
node_oil_data -->|"provides bounds"| node_user
node_ipca -->|"computes statistics"| node_interval_stats
node_interval_stats -->|"uses interval types"| node_intervals
node_ipca -->|"uses interval types"| node_intervals
node_midrad -->|"uses interval types"| node_intervals
node_symbolic -->|"uses interval types"| node_intervals
node_user -.->|"plots scores"| node_visualization

click node_intervals "https://github.com/apostolos00tapsas/interval-pca/blob/main/interval_pca/interval_algebra.py"
click node_interval_stats "https://github.com/apostolos00tapsas/interval-pca/blob/main/interval_pca/interval_stats.py"
click node_ipca "https://github.com/apostolos00tapsas/interval-pca/blob/main/interval_pca/ipca.py"
click node_midrad "https://github.com/apostolos00tapsas/interval-pca/blob/main/interval_pca/midrad_pca.py"
click node_symbolic "https://github.com/apostolos00tapsas/interval-pca/blob/main/interval_pca/symbolic_pca.py"
click node_oil_data "https://github.com/apostolos00tapsas/interval-pca/blob/main/interval_pca/datasets.py"
click node_visualization "https://github.com/apostolos00tapsas/interval-pca/blob/main/interval_pca/vis.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_intervals,node_interval_stats,node_user toneBlue
class node_ipca,node_midrad,node_symbolic toneAmber
class node_oil_data,node_visualization toneMint
```

## Components

### Interval foundation

- [Interval arithmetic](https://github.com/apostolos00tapsas/interval-pca/blob/main/interval_pca/interval_algebra.py): `interval_pca/interval_algebra.py`
- [Interval statistics](https://github.com/apostolos00tapsas/interval-pca/blob/main/interval_pca/interval_stats.py): `interval_pca/interval_stats.py`

### PCA methods

- [IntervalPCA](https://github.com/apostolos00tapsas/interval-pca/blob/main/interval_pca/ipca.py): `interval_pca/ipca.py`
- [Midpoint-radius PCA](https://github.com/apostolos00tapsas/interval-pca/blob/main/interval_pca/midrad_pca.py): `interval_pca/midrad_pca.py`
- [Symbolic PCA](https://github.com/apostolos00tapsas/interval-pca/blob/main/interval_pca/symbolic_pca.py): `interval_pca/symbolic_pca.py`

### Data and plotting

- [Oil data](https://github.com/apostolos00tapsas/interval-pca/blob/main/interval_pca/datasets.py): `interval_pca/datasets.py`
- [PCA plots](https://github.com/apostolos00tapsas/interval-pca/blob/main/interval_pca/vis.py): `interval_pca/vis.py`

### Other components

- **Library user**

## Connections

- Library user → IntervalPCA: fits bounds (evidence: `README.md`)
- Library user → Midpoint-radius PCA: fits bounds (evidence: `README.md`)
- Library user → Symbolic PCA: fits bounds (evidence: `README.md`)
- Oil data → Library user: provides bounds (evidence: `README.md`)
- IntervalPCA → Interval statistics: computes statistics (evidence: `interval_pca/ipca.py`)
- Interval statistics → Interval arithmetic: uses interval types (evidence: `interval_pca/interval_stats.py`)
- IntervalPCA → Interval arithmetic: uses interval types (evidence: `interval_pca/ipca.py`)
- Midpoint-radius PCA → Interval arithmetic: uses interval types (evidence: `interval_pca/midrad_pca.py`)
- Symbolic PCA → Interval arithmetic: uses interval types (evidence: `interval_pca/symbolic_pca.py`)
- Library user → PCA plots: plots scores
