[Numpy-discussion] Upper and lower envelopes

David Huard david.huard@gmail....
Tue Sep 30 21:28:38 CDT 2008


On Tue, Sep 30, 2008 at 4:37 PM, Anne Archibald
<peridot.faceted@gmail.com>wrote:

> 2008/9/30 bevan <bevan07@gmail.com>:
> > Hello,
> >
> > I have some XY data.  I would like to generate the equations for an upper
> and
> > lower envelope that excludes a percentage of the data points.
> >
> > I would like to define the slope of the envelope line (say 3) and then
> have my
> > code find the intercept that fits my requirements (say 5% of data below
> the
> > lower envelope).  This would then give me the equation and I could plot
> the
> > upper and lower envelopes.
> >
> >
> > I hope this makes sense.  Thanks for any help.
>
> For this particular problem - where you know the slope - it's not too
> hard. If the slope is b, and your points are x and y, compute y-b*x,
> then sort that array, and choose the 5th and 95th percentile values.
>

That's a pretty elegant solution.

Thanks for sharing,

David

>
> Anne
> _______________________________________________
> Numpy-discussion mailing list
> Numpy-discussion@scipy.org
> http://projects.scipy.org/mailman/listinfo/numpy-discussion
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://projects.scipy.org/pipermail/numpy-discussion/attachments/20080930/9a7fbcc7/attachment-0001.html 


More information about the Numpy-discussion mailing list