I got a question from a friend: how do I fit a function, using least-squares, to analyze the residuals. To answer that I cook this notebook up and made a post out of it ;-)
For the example I create a fake tidal signal, that we want fit and remove, added ...