I am trying to fit a measured spectrum with a linear combination of end-member spectra which are approximated by cubic spline functions ($f_1$ and $f_2$). I also need to incorporate terms that account for a constant background, as well as inaccuracies in wavelength ($\lambda$). This last part makes the system non-linear: $$ y_i = a\ f_1(m \lambda_i + c) + b\ f_2(m \lambda_i + c) + d $$ So I have a measured spectrum at multiple (>1000) wavelengths and am fitting the terms $a$, $b$, $m$, $c$ and $d$.
I'm trying to work out the Jacobian for this system, but am unsure where to start... the wavelength shift terms make it rather more complex than I know how to approach!
Any pointers for how to start this would be greatly appreciated!