RANSAC for multiple-line fitting and future prediction

This post uses the water level at a hydroelectric plant&rsquo;s reservoir over the past year to derive a set of lines that approximately describe the water level&rsquo;s changes across time, with a view to predicting the point in time at which the reservoir would empty and blackouts would possibly ensue.