2
$\begingroup$

I would like to know how this function is named to find how to calculate it. I have a trend like this one and want to find the upper and lower lines, the red ones (as you can see I do not have a great level at mathematics :) ):

enter image description here

EDIT: A better image using a real chart (in this case i need the name or the algorithm to find the black lines)

enter image description here

EDIT2: I would define the function like: from a top in a given (t) trace a line to the next top that does not create a line that cross the function. From a down in a given (t) trace a line to the next down that does not creates a line that cross the function.

This will create multiple lines, I'm ok with that, like in the following picture: I did the question 'cos I thought that this should be something common, please, if it's the first time you see something like this tell me and I will create everything from scratch!

enter image description here

  • 0
    As Srivatsan pointed out, if the graph were to extend further to the right, the lines would cross and could therefore no longer bound the graph; so I assume you intend the graph to be only what you've shown. In that case, note that the lines that you've drawn aren't uniquely defined. For instance, the upper red line in the first example could be drawn to pass through the two rightmost maxima instead, and likewise for the lower red line and the rightmost minima. The black lines, too, could be chosen differently. Any two maxima/minima on the convex hull of the graph could be chosen.2011-09-21

1 Answers 1

3

From your second edit, it appears that you are looking for lines bounding the convex hull of the graph. There are various algorithms for computing the convex hull of a set of points.

  • 0
    Again, you're right :)2011-09-21