What are the connections between square integrable functions in the context of Fourier series and least squares regression? $L^2([0,1])$ integrability is a condition to express a periodic function as a Fourier series:
$$\left\vert \int_{0}^L f(x)- \int_{0}^L \sum_{k=-n}^n \hat f(k)\;\mathrm e^{\frac{2\pi}{L} kx} \right \vert^2\mathrm dx\to0$$
as $n\to \infty.$
The idea is that the infinity FS converges to the function as mean square convergence.
I don't know if any parallels in conceptual framework can be established between this idea of convergence and the estimation of a least square regression (OLS) hyperplane minimizing squared differences between predicted and actual values. And if so, in what sense these concepts are connected.
Could the FS be interpreted as an OLS approximation to an overdeteemined problem?
 A: For an inner product space $X$, the least squares approximation to $f\in X$ by a set of independent vectors $\{ x_1,x_2,\cdots,x_n \}$ is the combination $\sum_{n=1}^{n}\alpha_n x_n$ that minimizes
$$
              \left\|f - \sum_{k=1}^{n}\alpha_k x_k\right\|^2.
$$
This is equivalent to knowing that $f-\sum_{k=1}^{n}\alpha_k x_k$ is orthogonal to every $x_k$ for $1\le k\le n$. In the case of an orthonormal set $\{ e_k \}_{k=1}^{n}$, the least squares approximation is
$$
              \sum_{k=1}^{n}\langle f,e_k\rangle e_k.
$$
The exponentials $\left\{ e_k(x)=e^{2\pi ikx/L}\right\}_{k=-n}^{n}$ form an orthonormal set in $L^2[0,1]$ and the corresponding least squares approximation to $f\in L^2[0,1]$ by this set is the truncated Fourier series
$$
           \sum_{k=-n}^{n}\langle f,e_k\rangle e_k = \sum_{k=-n}^{n}\left(\int_{0}^{1}f(t)e^{-2\pi ikt}dt\right)e^{2\pi ikx}.
$$
The least squares approximation is the closest-point projection, which is the same as the orthogonal projection. This is the principle you learned in Calculus for $\mathbb{R}^2$ and $\mathbb{R}^3$, and it also holds in an infinite-dimensional Hilbert space.
