Least square polynomial fitting

Least square polynomial fitting problem

Given $f\in C[a,b]$ and a weight function $w(x)\geq 0$, find the (weighted) least square approximant $$ \begin{align*} p^\ast = \arg \min_{p\in \mathcal{P}_n} \|f-p\|_{w} \end{align*} $$ where $$ \begin{align*} \|f-p\|_w = \left(\int_{a}^{b} |f-g|^2 w \d x\right)^{1/2}. \end{align*} $$

Theorem (least square approximant) open_in_new

For a least square polynomial fitting problem, let $(Q_k)_{k=0}^n$ be the orthogonal polynomials.

Then the least square approximant is given by $$ \begin{align*} p^\ast = \sum_{k=0}^{n} \frac{\langle f,Q_k\rangle}{\|Q_k\|^2} Q_k \in \mathcal{P}_n \end{align*} $$ with error $$ \begin{align*} \|f-p^\ast\|^2 = \|f\|^2 - \|p^\ast\|^2 = \|f\|^2 - \sum_{k=0}^{n} \frac{\langle f,Q_k\rangle^2}{\|Q_k\|^2}. \end{align*} $$

Proof

Theorem (Parseval's identity for orthogonal polynomials) open_in_new

Given a weighted inner product with $[a,b]$ finite, let $(Q_k)_{k=0}^n$ be the orthogonal polynomials.

Then for any $f\in C[a,b]$, $$ \begin{align*} \sum_{k=0}^{\infty} \frac{\langle f,Q_k\rangle^2}{\|Q_k\|^2} = \|f\|^2. \end{align*} $$

Proof

  • To find a polynomial $p$ such that $\|f-p\|\leq ε$, compute the partial sums $\sum_{k=0}^{N} \frac{\langle f,Q_k\rangle^2}{\|Q_k\|^2}$ until it is at least $\|f\|^2 - ε^2$.