schwiggiddy
New Member
- Joined
- Sep 5, 2017
- Messages
- 31
I have a dataset that includes the day of the sample data, the result for that day, and using Power BI, I've calculated a linear regression formula based on these two columns.
Here's the rub. I'm looking to create a rolling linear regression. Out of the 100 or so days in the set, what's the linear regression for the previous 10 days, for example, but for each day. Simple enough, but now, for each day, what is the difference between the calculated linear regression line from that day's data, and what is the largest difference of all the 10 days, for each day?
So for day 100, the regression formula is a y=mx+b expression with m and b in separate columns. I think I need to plug in the x and determine the y for each of the previous 10 days' values and take the max and min of that set of numbers to find the furthest values from the regression line over the previous 10 days (which days do not matter). Then repeat for day 99, looking back on the 10 days prior to that with m and b values unique to that day, and repeat for each row of data to have a rolling max deviation from the regression line.
Is there a function like List.Range that would allow each row to have these operations made to it?
Here's the rub. I'm looking to create a rolling linear regression. Out of the 100 or so days in the set, what's the linear regression for the previous 10 days, for example, but for each day. Simple enough, but now, for each day, what is the difference between the calculated linear regression line from that day's data, and what is the largest difference of all the 10 days, for each day?
So for day 100, the regression formula is a y=mx+b expression with m and b in separate columns. I think I need to plug in the x and determine the y for each of the previous 10 days' values and take the max and min of that set of numbers to find the furthest values from the regression line over the previous 10 days (which days do not matter). Then repeat for day 99, looking back on the 10 days prior to that with m and b values unique to that day, and repeat for each row of data to have a rolling max deviation from the regression line.
Is there a function like List.Range that would allow each row to have these operations made to it?