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?


migrated from mathematica.stackexchange.com Feb 10 at 15:41

This question came from our site for users of Wolfram Mathematica.

  • $\begingroup$ 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. $\endgroup$ – Henrik Schumacher Feb 8 at 8:46
  • 4
    $\begingroup$ Look at the change of the logarithm of the function. $\endgroup$ – Roman Feb 8 at 9:08
  • $\begingroup$ Roman, I don't speak math. From my perspective, I do not have function, only X,Y data points. $\endgroup$ – Doege Feb 8 at 9:48
  • 2
    $\begingroup$ 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. $\endgroup$ – Roman Feb 8 at 10:32

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)


Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.