I need a linear least squares type of fitting algorithm that understands how to weight the probability of a response coming from certain functions over another.
To explain, given the standard linear least squares problem:
$$
\textbf{Y} = \textbf{X} \mathbf{\beta} + \mathbf{\epsilon}
$$
where $\textbf{Y}$ is the response vector, $\textbf{X}$ is the design matrix, $\beta$ is the solution vector, and $\epsilon$ is the residual vector - Is there a linear way to implement a 'weight' on a certain function (column) within the design matrix, such that this function (or set of functions) have a higher propensity to fit closer to the data than the other functions?
I have stumbled across weighted linear least squares, but that appears to assign higher propensity to fit certain sections of the response more accurately than the rest of the response via a diagonalized weight matrix (if I am looking at it right). I believe my problem is different.
For instance, given a $\textbf{Y}$ of experimental data such as this:
with one function (column) of the design matrix such as this in red:
and other functions which make up the design matrix with much larger derivatives (incommensurate with that of the spectral response of $\textbf{Y}$):
We may end up getting a better linear fit by choosing non zero values for the several small spectral responses over the one larger one, which may make more physical sense (although there has been some error in calculating where the mean is). So we end up with a choice of the red or orange lines given here:
Is there a way of making sure that the spectral responses ahve similar underlying profiles, or that small derivative functions prevail in fitting where the experimental data has a small derivative itself?