Re: Area Under Curve (Min Length Interval)

*To*: mathgroup at smc.vnet.net*Subject*: [mg53901] Re: Area Under Curve (Min Length Interval)*From*: "Carl K. Woll" <carlw at u.washington.edu>*Date*: Wed, 2 Feb 2005 18:10:43 -0500 (EST)*Organization*: University of Washington*References*: <ctqdm2$sd3$1@smc.vnet.net>*Sender*: owner-wri-mathgroup at wolfram.com

Bruce, One approach is to use a little calculus and FindRoot. Loading the appropriate package, and defining F, In[1]:= <<Statistics`ContinuousDistributions` In[2]:= F[x_] := CDF[ChiSquareDistribution[5], x] we find that In[5]:= FindRoot[{F'[b]-F'[a]==0,F[b]-F[a]==93/100},{a,1},{b,5}] Out[5]= {a -> 0.37253, b -> 10.3441} Carl Woll "Bruce Colletti" <vze269bv at verizon.net> wrote in message news:ctqdm2$sd3$1 at smc.vnet.net... > Re Mathematica 5.1. > > How would I compute the minimum length interval over which the area under > f(x) is given? > > For instance, as shown below, f(x) is the PDF of a chi-square distributed > random variable whose CDF is F[x]. Seeking the minimum length > 93%-interval [a,b], the code returns "Obtained solution does not satisfy > the following constraints within Tolerance -> 0.001..." Fiddling with > options has been futile. > > Any ideas? Thankx. > > Bruce > > F[x_] := CDF[ChiSquareDistribution[5], x] > > Minimize[{b - a, F[b] - F[a] == 0.93, b > a > 0}, {a, b}] > > NMinimize[{b - a, F[b] - F[a] == 0.93, b > a > 0}, {a, b}] > >