Jump to content
We've recently updated our Privacy Statement, available here. ×

Rolling slope and y-intercept

Chung-Kan Huang

Recommended Posts



I wonder if there is an easy / simple way to compute the rolling slope and y-intercept for time series data with in Spotfire.

My data have following columns

date well d1 d2

Provide that d2 = m * d1 + a and I would like to add columns for 'm' and 'a' for each well using the data points from 'M' previous dates.

Size of date and well would be around a few thousands for each.

I can write scripts to perform all the calculation I need outside of the Spotfire but I am curious if anything always avialable for me inside the Spotfire would allow me to do this more efficiently.

Please let me know if you are any suggestions for the problem or I am not being clear enough.





Link to comment
Share on other sites

Assuming [M] is an integer document property, something along the lines of this might be what you are after:

Slope/gradient over last M points:

[slope] = ([D2] -Sum([D2]) over (Intersect([Well],Previous([D1],${M}))) ) /

[D1] -Sum([D1]) over (Intersect([Well],Previous([D1],${M})))

Then you could calculate the value of [A] as

[A] = [D2] - ([D1] * [slope])

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Create New...