08-29-2014 02:16 AM
Hi all!
I have the following problem:
I measure an distribution density and calculate corresponding cumulative distribution function of the measured data. Now I need to know some specific x-values, for example where is the CDF at 50%. To do that, I tried to interpolate the CDF with SpInterp() with interchanged X and Y-arrays. Befor I can use SpInterp() I need to calculate the second derivatives with Spline(). But Spline() gives me allways a runtime error, because the x-values must be distinct. I get the same problem with PolyInterp(). RatInterp() works, but gives sometimes very bad results, so it's not usable in this case.
Has anyone an idea?
Best regards,
Thomas
09-02-2014 08:31 AM
Hi!
you measure a distribution density, so I figure the x-value are distinct, the y values are not. You get that problem by interchanging the arrays.
So, I suggest you don ´t do that.
If you look for the x-value for y=Y0 for instance:
Take your y-values and subract Y0, you get a zero crossing at for Values around Y0. Intergrate and you get a local maximum/minimum. That should be easy to detect.
Regards
René
09-03-2014 01:11 AM
Hi René,
good idea. I will try it out and compare it with my current solution.
I solved it this way: I interpolate the sum distribution to increase the resolution by 100. Then I can easily step through my array and find my y-values with sufficient accuracy.
Regards,
Thomas