Optimized linear regression over multiple timeseries and expanding time window in a Pandas dataframe
I have a dataframe holding multiple timeseries and I want to fit a line on each one and return the slope and intercept, and I want to do it in an expanding way: so first compute the intercept at the first time point, then at the second, …, all the way to the last.