MathGroup Archive 2008

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: Re: NIntegrate[UnitStep[...]PDF[...],{x,...}] hard to integrate

  • To: mathgroup at smc.vnet.net
  • Subject: [mg93432] Re: [mg93410] Re: NIntegrate[UnitStep[...]PDF[...],{x,...}] hard to integrate
  • From: "peter lindsay" <plindsay at mcs.st-and.ac.uk>
  • Date: Fri, 7 Nov 2008 06:02:48 -0500 (EST)
  • References: <200811060907.EAA16020@smc.vnet.net>

Mathematica 6 gives

g[0] = 0.438019 for the first problem

and  t -> -0.00124255 for the second. Takes several minutes though.
Peter

2008/11/6 Bill Rowe <readnews at sbcglobal.net>

> On 11/5/08 at 4:57 AM, erwann.rogard at gmail.com (er) wrote:
>
> >f[x_]=(0.014999775454701741*E^(5.264*x) +
> >E^(2.632*x)*(-0.012692488700608462 - 0.14964297032258167*x))/
> >(12.579644604014753 + 7.102251209677398*E^(2.632*x) + E^(5.264*x))
>
> >g[t_]:=NIntegrate[ UnitStep[t-f[x]] PDF[
> >NormalDistribution[0,1/2],x], {x,-Infinity,Infinity} ]
>
> >g[0] runs for a very long time before forcing the kernel to quit,
> >let alone FindRoot[g[t]==0.25,{t,-1,1}]
>
> >Note that f[x]PDF[NormalDistribution[0,1/2],x] integrates to 0 and i
> >virtually zero outside [-2,2]
>
> >I use Mathematica 5.2/Ubuntu/4GB/IntelCoreDuo2
>
> >any recommandation?
>
> I wonder if you have defined g as you intended.
>
> A plot of f[x] shows it everywhere positive except the interval
> from 0 to ~.8. This can be refined by doing
>
> In[8]:= FindRoot[f[x], {x, .8}]
>
> Out[8]= {x->0.84719}
>
> So, UnitStep[t-f[x]] will be 0 outside this interval when t = 0.
> This means g[0] amounts to integrating the PDF of a normal
> distribution from 0 to .84719. For any distribution the integral
> of the PDF is the CDF. The median of NormalDistribution[0,a] is
> 0. So, g[0] must be
>
> In[10]:= CDF[NormalDistribution[0, 1/2], .84719] - .5
>
> Out[10]= 0.454903
>
> The way you have set the problem up, you are asking Mathematica
> to do a lot more work than is needed to solve the problem.
>
>


-- 
peter lindsay
computing officer
mathematical institute
university of st andrews
ky16 9ss

phone: 01334-463756

The University of St Andrews is a charity registered in Scotland : No
SC013532



  • Prev by Date: Re: Re: Constructing a Label
  • Next by Date: Plot descending x- Values
  • Previous by thread: Re: NIntegrate[UnitStep[...]PDF[...],{x,...}] hard to integrate
  • Next by thread: Re: NIntegrate[UnitStep[...]PDF[...],{x,...}] hard to integrate