MathGroup Archive 2008

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

Search the Archive

NIntegrate problem

  • To: mathgroup at smc.vnet.net
  • Subject: [mg84719] NIntegrate problem
  • From: Outof Africa <renaysingh at gmail.com>
  • Date: Fri, 11 Jan 2008 04:41:03 -0500 (EST)

Hi All

I would really appreciate any help on the following code. I get errors
(a lot of them) in the from In[6] onwards....

===================================================================
In[1]:= ndist = NormalDistribution[0, 1];

In[2]:= a = Quantile[ndist, 0.05]

Out[2]= -1.64485

In[3]:= f[x_?NumericQ] := 1/Sqrt[2 \[Pi]] Exp[-x^2/2]


In[4]:= g[t_?NumericQ] :=
 NIntegrate[f[u]*CDF[ndist, (t - u)], {u, a, \[Infinity]}]

In[5]:= b = b /. FindRoot[g[b] == 0.05, {b, -1}]

Out[5]= -2.03202

In[6]:= h[x_?NumericQ] :=  NIntegrate[  f[u]*Exp[-(x - u)^2/2]/Sqrt[2 \
[Pi]], {u, a, \[Infinity]}]


In[7]:= gg[t_?NumericQ] :=  Integrate[  h[u]*CDF[ndist, (t - u)/Sqrt[\
[Delta]]], {u, b, \[Infinity]}]


In[8]:= c = c /. FindRoot[gg[c] == 0.05, {c, -2}]


  • Prev by Date: ListContourPlot
  • Next by Date: Re: Usage of **
  • Previous by thread: Re: ListContourPlot
  • Next by thread: Re: NIntegrate problem