Multi-slope regression

Hello,

Linear regression is possible using regress, but is it possible (feasible) to find and compute multiple linear slopes in data? See attached.

The key is finding the break of slope or turning points.

It can be done manually of course.

Lester

With a very clean dataset, you could use second derivative to find the “break of slope”, but with your example, this point reveals to be more subjective. For example, how many segments do you need and what’s their relevance ?

Should be trivial in Julia with GMT pus this package.