0

I am trying to form a method for finding if plotted data is in equilibrium. In most cases calculating linear least squares and checking for the slope is enough. However I am now plotting data that span over 15 orders of magnitude from 1 down to ^-15. Well down there the slope is going to be very small in any case so just evaluating if the slope is smaller that something will not work.

How do I check for relative change that doesn't depend on the magnitude of the value. Do I just divide the change (of duration z) by the average of Y values of the duration z? Intuitively that seems to be some sort unitless relative change in the duration z.

1 to 0.9 in one second = 10.5% change/s

0.1 to 0.09 in one second = 10.5% change/s

0.000 000 000 000 001 to 0.000 000 000 000 000 9 in one second = 10.5% change/s

Is it this simple or am I missing something?

Doege
  • 111
  • A relative change from a to b in percentage would be calculated as follows: 100 (b/a - 1). In each of your examples, one would end up with - 10 % relative change per second. – Henrik Schumacher Feb 08 '19 at 08:46
  • 4
    Look at the change of the logarithm of the function. – Roman Feb 08 '19 at 09:08
  • Roman, I don't speak math. From my perspective, I do not have function, only X,Y data points. –  Feb 08 '19 at 09:48
  • 2
    If you're just trying to visually see convergence, then you could replace ListPlot with ListLogPlot. If you're trying to measure relative slope, then convert the data set A={{x1,y1},{x2,y2},...} into B={#[[1]], Log[#[[2]]]} & /@ A before making any measurements. – Roman Feb 08 '19 at 10:32

1 Answers1

1

I take amount z of points covering the desired span of time from the end of the data.

Adjust x/time values so the data starts from 0

Calculate linear least squares

Relative change in the given sample duration = ((Slope * Duration + Offset) / Offset) - 1

(Thanks Henrik)

Doege
  • 111