why in regularisation, we'd assume a dummy basis function? On p.328 of Introduction to Applied Linear Algebra – Vectors, Matrices, and Least Squares by
Stephen Boyd and Lieven Vandenberghe, the authors write that for regularised data fitting, we should minimise $||y-A\theta||^2+\lambda||\theta_{2:p}||^2$, and we'd assume $f_1$ is the constant function. But I can't seem to understand why we'd want to assume a constant function?
I tried to found some explanation from the book and online, and I know the answer may be very obvious, but after some search but I still can't seem to understand why. Here's what I found:
On the same page, the book said:

There is one exception here: if $f_i(x)$ is constant (for example, the number one), then we should not worry about the size of $θ_i$, since $f_i(x)$ never varies. But we would like all the others to be small, if possible.

On p.138 of Pattern Recognition and Machine Learning, Christopher Bishop writes:

It's often convenient to define an additional dummy function $\phi_0(x)=1$...

Any further explanation would be greatly appreciated.
 A: In the absence of any explanatory information ("features"), a reasonable guess of the outcome is the sample mean. Including an intercept/constant function is a natural way to model the mean of the outcome, all else being zero.
In other words, if all you have is the vector $y$, what value would you use to describe a "typical" outcome? One way to characterize "typical" is the mean; indeed, the mean is the value of $a$ that minimizes $E[(y-a)^2]$, which has an obvious relationship to the objective function in your post. (Naturally, alternative choices "typical" values may be preferred because these choices minimize alternative loss functions.)
This passage you quote

There is one exception here: if $f_i(x)$ is constant (for example, the number one), then we should not worry about the size of $\theta_i$, since $f_i(x)$ never varies. But we would like all the others to be small, if possible.

makes a slightly different argument. This is motivated from an assumption that we want to penalize rapid changes in the model wrt $x$. But since $f_1$ is constant, its variation is the smallest possible (i.e. zero), so no penalty is necessary to discourage large variation.
