comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » Error bars
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Switch to threaded view of this topic Create a new topic Submit Reply
Error bars [message #45409] Thu, 08 September 2005 12:28
MA is currently offline  MA
Messages: 15
Registered: August 2005
Junior Member
Hello,
I have a (scientific) problem and could use some help on how to best
solve it with IDL. I am trying to calculate a confidence interval on a
cloud fraction that can range between 0 and 1. I have a mathematical
function that calculates the probability of occurrence of all cloud
fractions between 0 and 1, given a couple of input parameters, e.g.

t=250. ;; constant, number of samples
s=120. ;; number of cloudy samples, can range between 0 and t
n=3. ;; number of 'gaps' between continuously cloudy samples
y=IndGen(1000)/999. ;; this is arbitrary, could choose more/less
points between 0 and 1
p=FltArr(1000)
p=(s^(n-1.)*(t-s)^n*(1./y-1.)^n*Factorial(2.*n-1.))/ $
((s/y+t-2.*s)^(2.*n-1.)*(y-1.)^2.*Factorial(n)*Factorial(n-1 .))

This curve can be a nice bell shape (as with the parameters above), but
can also be flat (if probability is same everywhere) or be very skewed,
to the point where the curve goes to infinity (in IDL world) (you can
fiddle around with s and n for that, though n>=1). The first and last
entry in the array are often either NaN (s/y=NaN for y=0) or Inf.
To find the 90% error bar on the cloud fraction, I have to find the two
cloud fractions between which 90% of the area under the curve lies.
Is there a smart way to calculate this error bar? Graphically, I'd draw
a horizontal line across the plot, see at what cloud fractions it
intercepts the curve, calculate the area under the curve between those
cloud fractions. If it's more/less than 90%, I'd lift/lower the
horizontal line and repeat. I've tried to mimic this process in my
program, but it takes forever and is not very accurate. Also, the
infinity/NaN values are really annoying (though pysically correct,
since the function only applies for fractions between 0,1, exclusive of
those values), because the total area under the curve is no longer 1.
Any suggestions on how to do this better? Maybe something with
Histogram?
Thanks
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Re: Postscript colour sampler?
Next Topic: realizing the formula in idl

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Wed Oct 08 19:20:37 PDT 2025

Total time taken to generate the page: 0.00460 seconds