# How to curve-fit the lower envelope of random sequence?

I'm more or less familiar with procedures and methods to fit a curve to experimental data, and I have done this many times using Matlab. However this time I have a problem that I'm not sure how to solve and I'm stuck.

I have some experimental data which I have plotted in the figure below (blue curve). The data seem to be lowerbounded by some kind of smooth logarithmic-like curve like the red line shown in the figure (I have plotted this red curve manually using Paint just to illustrate what I mean).

I have several mathematical expressions that could be good candidates to fit the red line, but I'm not sure how to fit them in the way shown in the figure. Standard data fitting procedures use the whole data set and provide a curve somewhere in the middle of the blue curve, but I need something like the red curve.

I work with Matlab and I have tried to use the envelope function (lower envelope), the absolute value of the Hilbert transform and the convex hull (convhull) but nothing works.

Any ideas or suggestions'

• You can use a convex hull to pick out the minima. But that will require you to first transform the data so that the minima lie on a convex curve rather than the current concave curve. Once you have picked up the minima you can fit the infimum curve to those points. – Biswajit Banerjee Nov 16 '20 at 23:51
• It is easy to say "find a curve that is some sort of lower bound", but it's substantially harder to say how this function should actually look like. That's because there are of course many functions that would all serve as lower bounds -- the blue curve itself is an example. So do you want a piecewise linear function? Something that's curved? Does it have to be concave? Etc. – Wolfgang Bangerth Nov 17 '20 at 0:25
• I would try plotting log-log, perhaps the red line will look straight then. – Maxim Umansky Nov 17 '20 at 2:33
• Welcome to Scicomp! Can you give us a bit of context what your data represents? Is there a good reason you assume experimental errors to be one-directional away from the lower bound curve? – MPIchael Nov 17 '20 at 9:21