cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Register for our Discovery Summit 2024 conference, Oct. 21-24, where you’ll learn, connect, and be inspired.
Choose Language Hide Translation Bar
RZordich
Level I

Looking for a formula to find the "elbow" in my data

Hi JMP friends,

(On regular JMP 18.0.1, example data attached)

 

 I am analyzing some data wherein I need to find the time (x point) at which my data has an "elbow" or inflection. I have an initial mini-peak in my data and have been doing this work manually. However, this is slow and I would like to automate it, as I will be doing this for hundreds of tests that return graphs similar to the below, with varying peak times/amounts and varying 'flat' times. The 'flat' times are generally not very flat, but rather very gradually decreasing. You can see in the attached image of the graph (Example/dummy data) what spot/area I would like to find.

 

Any help on what I could do would be really helpful. I think setting up a flag column would be a good way to find this, but am not sure of the JSL or formula I can use to have the flag work.

Any help on figuring this out would be great, thank you!

 

RZordich_2-1723075719846.png

 

 

 

 

1 REPLY 1
txnelson
Super User

Re: Looking for a formula to find the "elbow" in my data

I approached finding the elbow as the data point, where the next 10 data points are all greater than the previous data point.  This is absolutely a made up algorithm.  But it looks like it might be a possible way to identify the elbow.

 

txnelson_0-1723080855091.pngtxnelson_1-1723080898039.png

 

Here is the formula I created for the column I named Elbow

As Constant(
	flag = 0;
	lookAhead = 10;
);
val = .;
If( flag == 0 & Row() < N Rows( Current Data Table() ) - lookAhead,
	If(
		Min(
			:Counts[Index( Row() + 1, Row() + lookAhead + 1 )] - :Counts[
			Index( Row(), Row() + lookAhead )]
		) > 0,
		val = (flag = 1)
	)
);
val;
Jim