# Code Repository for Effective Span Dimension Experiments

This repository contains Python code to replicate the simulation experiments described
in our paper on Effective Span Dimension (ESD). The codebase is organized into core
utility modules and experiment-specific scripts.

## Core Modules:
- esd_modular_functions.py: Fundamental ESD calculation algorithms
- linear_model_modular_functions.py: Linear regression and alignment utilities
- generate_sequence.py: Signal and eigenvalue sequence generation

## Experiment Scripts:
- Section_6_1_OPGF.py: Implements over-parameterized gradient flow experiments and investigate the evolution of span profile under different misalignment settings
- Section_6_2_OPGF.py: (Parallel) Repeated Experiments on estimation errors and ESD evolution 
- Appendix_A_LinearModel.py: Explores the relationship between ESD and prediction risk in linear models across various alignment scenarios.
- Appendix_B_RKHS.py: Explores the relationship between ESD and prediction risk in RKHS setting across various alignment scenarios.
- LinearNet_RKHS_ESD.py: Explore the evolution of ESD of linear network representation. 

## Requirements

- Python 3.x
- NumPy
- SciPy 
- Matplotlib
- Pandas
- Multiprocessing support (for parallel experiments)

## Running the Experiments

1. Ensure all dependencies are installed:
   ```bash
   pip install numpy scipy matplotlib pandas
   ```

2. Execute any experiment script directly:
   ```bash
   python Section_6_1_OPGF.py
   ```

3. Results will be generated as PDF visualizations in the current directory

