cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Try the Materials Informatics Toolkit, which is designed to easily handle SMILES data. This and other helpful add-ins are available in the JMP® Marketplace
Choose Language Hide Translation Bar
Erez
Level I

Find the max slope

Hello everyone,

 

I have a list of points forming a slanted line, I am interested in knowing the maximum slope created by the curve.

I have a lot of sets of points so I'm interested in knowing how to do it in a formula.

 

For example, the numbers 1,2,3,4 form a straight line with a fixed slope of 1 so the max is 1. My numbers don't form a straight line so the equation is more complicated.

 

Attach a sample file.

Thanks.

1 ACCEPTED SOLUTION

Accepted Solutions
Craige_Hales
Super User

Re: Find the max slope

If the slopes are within each row, maybe this

 

Capturing the maximum change between columns.Capturing the maximum change between columns.

 

You might care about absolute value of the change. Abs(point3-point2) ...

You might need a scalable design, handling 100s of columns. That's possible using an array.

 

Craige

View solution in original post

5 REPLIES 5
Craige_Hales
Super User

Re: Find the max slope

If the slopes are within each row, maybe this

 

Capturing the maximum change between columns.Capturing the maximum change between columns.

 

You might care about absolute value of the change. Abs(point3-point2) ...

You might need a scalable design, handling 100s of columns. That's possible using an array.

 

Craige

Re: Find the max slope

Are you fitting a model and extracting the maximum first derivative, or are you just interested in the most significant difference between points?

Erez
Level I

Re: Find the max slope

I interested in the most significant difference between points.

That's why Craige_Hales' solution is good for me.

Thanks.

txnelson
Super User

Re: Find the max slope

Here is a modification to @Craige_Hales formula that removes the requirement to list each pair of columns

dt = Current Data Table();
Max( Abs( dt[Row(), Index( 1, N Cols( dt ) - 2 )] - dt[Row(), Index( 2, N Cols( dt ) - 1 )] ) );
Jim

Re: Find the max slope

Here is a different approach using a script. It accommodates any number of data points (data columns) and observations. It assumes that the data table is open and that the last column is dedicated to storing the result.