# MATH310S26 - Day 11: Fourier Regression and Complex Form
## Course Information
**Course**: MATH310 - Introduction to Mathematical Modeling
**Date**: February 9, 2026 (Day 11)
**Topics**: Fourier series with regression, Complex Fourier series, Introduction to Fourier transform pair
**Previous Day**: [[MATH310S26-Day10-Notes|Fourier Modes and Complex Form]]
## Administrative Notes
- Work day scheduled for Friday
- Continued feedback on MR02 submissions via Canvas
- Group formation remains flexible due to smaller class size (21-22 students)
- **MMCC (Minds Mathematics and Computing Collaborative)**: Seeking volunteers for high school STEM outreach
- Modeling ideas continuing to develop organically
## Main Topics
### 1. Square Integrable Functions and Inner Product Structure
Building from [[MATH310S26-Day10-Notes|Day 10's complex Fourier series]], we establish the theoretical foundation:
**Definition**: A function $f$ is **[square integrable](https://en.wikipedia.org/wiki/Square-integrable_function)** on $[-L, L]$ if:
$\int_{-L}^{L} |f(t)|^2 dt < \infty$
**Inner Product Structure**:
- **[Inner product](https://en.wikipedia.org/wiki/Inner_product_space)**: $\langle f, g \rangle = \int_{-L}^{L} f(t) \overline{g(t)} dt$
- **Norm**: $||f|| = \sqrt{\langle f, f \rangle}$ (finite length requirement)
- **Geometric interpretation**: Functions as "vectors" with finite magnitude
**Physical Interpretation**:
- **[Probability density functions](https://en.wikipedia.org/wiki/Probability_density_function)**: Must be normalizable
- **Energy considerations**: Only functions with finite energy are physically meaningful
- **Signal processing**: Square-integrable signals have finite power
### 2. Fourier Series as Regression Problem
#### Classical Fourier Series Review
For a $2L$-periodic, square-integrable function $f$:
$f(t) = a_0 + \sum_{n=1}^{\infty} \left[ a_n \cos(\omega_n t) + b_n \sin(\omega_n t) \right]$
where $\omega_n = \frac{n\pi}{L}$
#### Regression Formulation
**Time Series Data**: $S = \{(t_0, f_0), (t_1, f_1), \ldots, (t_k, f_k)\}$
**Model Equation**: For each data point $i = 1, 2, \ldots, k$:
$f_i = a_0 + \sum_{n=1}^{N} \left[ a_n \cos(\omega_n t_i) + b_n \sin(\omega_n t_i) \right] + \epsilon_i$
**Regression Parameters**: $\{a_0, a_1, b_1, a_2, b_2, \ldots, a_N, b_N\}$
#### Challenges in Fourier Regression
1. **Infinite Series Problem**: Must truncate $\sum_{n=1}^{\infty}$ to $\sum_{n=1}^{N}$
- **Solution**: Choose $N$ based on data size and desired fit
2. **Frequency Selection Problem**: $\omega_n$ values must be specified
- **Non-linearity**: Regression is non-linear in frequency parameters $\omega_n$
- **Solution**: Pre-specify frequencies based on domain knowledge
3. **Design Matrix Structure**: Once frequencies are fixed, this becomes standard [ordinary least squares](https://en.wikipedia.org/wiki/Ordinary_least_squares)
### 3. Sea Level Rise Case Study
#### Background and Motivation
**Data Source**: Global mean sea level trends from Kaggle (1993-2025)
**Research Question**: Are sea levels rising? What about oscillations?
**Model Framework**:
- **Data** = **Seasonality** + **Trend** + **Error**
- $\text{Data} = S + T + \epsilon$
#### Frequency Selection Strategy
**Time Scale**: Let $t = 1$ represent 1 year
**Target Frequencies**:
- **Annual cycle**: $\cos(2\pi t)$, $\sin(2\pi t)$ (period = 1 year)
- **Semi-annual cycle**: $\cos(4\pi t)$, $\sin(4\pi t)$ (period = 0.5 years)
**Regression Model**:
$f(t) \approx a_0 + a_1 \cos(2\pi t) + a_2 \cos(4\pi t) + b_1 \sin(2\pi t) + b_2 \sin(4\pi t)$
#### Results and Analysis
**Fourier Coefficients**: (From computational analysis)
- $a_0$: Large (baseline sea level)
- $a_1, b_1$: Moderate (annual variation)
- $a_2, b_2$: Smaller (semi-annual variation)
**Coefficient Pattern**: Generally decreasing magnitudes → good truncation choice
**De-seasonalized Trend Analysis**:
- **Linear trend**: 3.3005 mm/year (close to literature value ~4.3 mm/year)
- **Quadratic trend**: Reveals acceleration in sea level rise
- **$R^2$ values**: Both linear and quadratic fits show high correlation
#### Residual Analysis and El Niño Detection
**Key Finding**: After removing 1-year and 2-year cycles, residuals show structure
- **Source**: [El Niño-Southern Oscillation](https://en.wikipedia.org/wiki/El_Niño–Southern_Oscillation) (ENSO) cycles
- **Physical mechanism**: Pacific Ocean temperature cycles affect global sea levels
- **Frequency**: Irregular ~2-7 year cycles (not rigid annual patterns)
**Visualization Benefits**:
- Blue peaks (trend-only removal) vs. Red (seasonality + trend removal)
- Clear amplitude reduction demonstrates seasonal component removal
- Remaining oscillations reveal longer-term climate patterns
![[GMSL_Data_FourierRegression.pdf]]
### 4. Complex Fourier Series (Check your understanding)
#### Euler's Formula Application
From [[MATH310S26-Day10-Notes|Day 10]], using $e^{i\theta} = \cos(\theta) + i\sin(\theta)$:
**Complex Fourier Series**:
$f(t) = \sum_{n=-\infty}^{\infty} c_n e^{i\omega_n t}$
where:
$c_n = \frac{1}{2L} \int_{-L}^{L} f(t) e^{-i\omega_n t} dt$
#### Verification Example
**Test function**: $f(t) = 2$ (constant)
**Expected result**: Only $c_0 = 2$, all other $c_n = 0$
**Calculation**:
- When $n = 0$: $\omega_0 = 0$, so $e^{-i\omega_0 t} = 1$
- $c_0 = \frac{1}{2L} \int_{-L}^{L} 2 \cdot 1 \, dt = \frac{2 \cdot 2L}{2L} = 2$ ✓
- When $n \neq 0$: $\int_{-L}^{L} e^{-i\omega_n t} dt = 0$
### 5. Fourier Transform Preview
#### Conceptual Foundation
**Current Limitation**: Discrete frequencies $\omega_n = \frac{n\pi}{L}$
**Goal**: Extend to continuous frequency spectrum
**Mathematical Transition**:
- Complex Fourier series: $f(t) = \sum_{n=-\infty}^{\infty} c_n e^{i\omega_n t}$
- **Fourier transform pair**: $L \to \infty$ limit transforms sum to integral
**Applications Preview**:
- **[Fast Fourier Transform](https://en.wikipedia.org/wiki/Fast_Fourier_transform) (FFT)**: Efficient computation
- **Time series analysis**: Non-periodic data
- **Signal processing**: Arbitrary frequency content
### 6. Visual Demonstrations and Energy Concepts
#### Ptolemaic vs. Copernican Analogy
**YouTube demonstrations** (Homer parametric curve and sawtooth wave construction):
- **Circles on circles**: Each Fourier coefficient as a rotating circle
- 
- **Decreasing amplitudes**: Higher frequencies contribute less energy
- 
- **Shape reconstruction**: Complex shapes from simple harmonic components
#### Energy per Frequency Interpretation
**Key Insight**: Fourier coefficients represent "energy" at each frequency
- **Frequency domain**: Each coefficient shows contribution of that frequency
- **Spectral analysis**: Understanding which frequencies dominate
- **Engineering applications**: Filter design, noise reduction
## Check Your Understanding
1. **Regression Setup**: Given time series data with 100 points, what's the maximum number of Fourier coefficients you could reasonably estimate? Why?
2. **Complex Form Verification**: For $f(t) = 2$, show that all $c_n = 0$ except $c_0 = 2$ using the complex Fourier coefficient formula.
3. **Frequency Selection**: For sea level data, why might you choose annual and semi-annual cycles? What other frequencies might be relevant?
4. **Orthogonality**: Explain why $\int_{-L}^{L} e^{-i\omega_n t} dt = 0$ when $n \neq 0$.
5. **Physical Interpretation**: What does it mean for a function to be "square integrable" in the context of physical signals?
## Key Takeaways
1. **Fourier as regression**: Classical Fourier series becomes practical data analysis tool
2. **Frequency pre-specification**: Domain knowledge guides frequency selection
3. **Decomposition power**: Separating seasonal, trend, and irregular components
4. **Complex form elegance**: Unified treatment of positive and negative frequencies
5. **Real-world applications**: Climate data reveals multiple time scales simultaneously
6. **Energy interpretation**: Fourier coefficients as frequency-domain energy distribution
## Mathematical Connections
- **Previous**: [[MATH310S26-Day3-WorkdayMaterials (Two-by-two matrices, normal equations, and ordinary least squares)|Ordinary least squares]] → [[MATH310S26-Day6-Work|PCA]] → [[MATH310S26-Day7-Notes|Fourier series]]
- **Current**: Fourier regression bridges pure mathematics and data analysis
- **Next**: [Fourier transforms](https://en.wikipedia.org/wiki/Fourier_transform) and [FFT algorithms](https://en.wikipedia.org/wiki/Fast_Fourier_transform) for modern signal processing
## Code Implementation Notes
*(For future development)*
**Python/R/MATLAB Implementation**:
1. Design matrix construction with trigonometric basis functions
2. Frequency specification and coefficient estimation
3. Seasonal decomposition and residual analysis
4. Visualization of frequency domain representation
## References
- [Fourier series](https://en.wikipedia.org/wiki/Fourier_series)
- [Square-integrable function](https://en.wikipedia.org/wiki/Square-integrable_function)
- [El Niño–Southern Oscillation](https://en.wikipedia.org/wiki/El_Niño–Southern_Oscillation)
- [Seasonal decomposition](https://en.wikipedia.org/wiki/Seasonal_decomposition_of_time_series)
- [Complex exponential](https://en.wikipedia.org/wiki/Complex_exponential_function)
- [Inner product space](https://en.wikipedia.org/wiki/Inner_product_space)
- [Orthogonality](https://en.wikipedia.org/wiki/Orthogonality)
- [Fast Fourier Transform](https://en.wikipedia.org/wiki/Fast_Fourier_transform)
- [Signal processing](https://en.wikipedia.org/wiki/Signal_processing)