Least-squares regularization matrix is not positive definite?

143 Views Asked by At

I am fitting data $(x_i,y_i)$ to the following model: $$ f(x) = \sum_j a_j g_j(x) = a^T g(x) $$ where $g_j(x)$ are well-conditioned basis functions (in my application they are B-splines, but I don't think that matters for this question).

I want to regularize the result by smoothing (damping) the function by minimizing the second derivative. This means my solution $a$ is given by $$ a = \textrm{argmin } ||y - X a||^2 + \lambda^2 \int_{-\infty}^{\infty} \left| \frac{d^2 f(x)}{dx^2} \right|^2 dx $$ where $X_{ij} = g_j(x_i)$ is the least-squares matrix, and the regularization term can be expressed as: \begin{align*} \int_{-\infty}^{\infty} \left| \frac{d^2 f(x)}{dx^2} \right|^2 dx &= \int_{-\infty}^{\infty} \left( a^T g'' \right)^2 dx \\ &= \int_{-\infty}^{\infty} a^T g'' g''^T a dx \\ &= a^T \left( \int_{-\infty}^{\infty} g'' g''^T dx \right) a \\ &= a^T G a \end{align*} where $$ G_{ij} = \int_{-\infty}^{\infty} \frac{d^2 g_i(x)}{dx^2} \frac{d^2 g_j(x)}{dx^2} dx $$ So, now my solution is given by the standard form: $$ a = \textrm{argmin } ||y - X a||^2 + \lambda^2 a^T G a $$ I was trying to compute the Cholesky factor of $G = L L^T$ so that I could express this as $$ a = \textrm{argmin } ||y - X a||^2 + \lambda^2 ||L a||^2 $$ so that I can use a generalized SVD or QR approach to solve the system. However, to my surprise, I found that $G$ was not positive definite - it had one zero eigenvalue.

My question is: shouldn't the matrix $G$ be positive definite as defined above, since the basis function $g_j(x)$ are positive and well-conditioned? Again, in my application the $g_j(x)$ are B-splines.

I am trying to determine if I made a mistake when computing the $G$ matrix.

Alternatively, does anyone see another way to compute the regularization matrix $L$, aside from a Cholesky factorization of $G$?