I've got two time-series, S (stress in a railway track) and T (temperature). The time-series are several months long. The relationship is linear, however, it can change subtly or 'jump' at some points, due to work done on the rails.
Currently, I'm doing linear regression on a per-day basis, and then temperature-correcting S based on that days models. However, changes in the relationship do happen within each day, so this is not perfect.
I guess I'm trying to figure out how to best fit multiple linear models between S/T over time. How would I go about doing that? I've just started out with R, though I'm also good with Python.