Re: Integrate Problems

• To: mathgroup at smc.vnet.net
• Subject: [mg22378] Re: [mg22350] Integrate Problems
• From: BobHanlon at aol.com
• Date: Sat, 26 Feb 2000 22:05:05 -0500 (EST)
• Sender: owner-wri-mathgroup at wolfram.com

The following is for version 3

Since you are working with a distribution, make use of the standard add-on
packages

Needs["Statistics`NormalDistribution`"]

PDF[NormalDistribution[a, b], x]

1/(E^((-a + x)^2/(2*b^2))*b*Sqrt[2*Pi])

Integrating from -Infinity to Infinity. Symbolically:

Limit[CDF[NormalDistribution[a, b], a+n*b], n -> Infinity]

1

or, with a change in variable, t = (x-a)/b

CDF[NormalDistribution[0, 1], Infinity]

1

For the specific distribution:

CDF[NormalDistribution[40000, 4000], Infinity]

1

Integrating from -Infinity to zero

CDF[NormalDistribution[a, b], 0]

(1 - Erf[a/(Sqrt[2]*b)])/2

CDF[NormalDistribution[40000, 4000], 0]

1/2*(1 - Erf[5*Sqrt[2]])

%//N

0.

Integrating from -Infinity to the mean

CDF[NormalDistribution[a, b], a]

1/2

Integrals from 0 to Infinity would be

(1- CDF[NormalDistribution[a, b], 0])//Simplify

1/2*(1 + Erf[a/(Sqrt[2]*b)])

(1- CDF[NormalDistribution[40000, 4000], 0])//Simplify

1/2*(1 + Erf[5*Sqrt[2]])

%//N

1.

Bob Hanlon

In a message dated 2/25/2000 10:59:59 PM, com3 at ix.netcom.com writes:

>Can someone provide some help with the following results I get from
>version 3 ?
>
>a=40000
>b=4000
>f[x_]:=(1/(b*(2*Pi)^.5))*Exp[(-1/2)*((x-a)/b)^2]
>
>Integrate[f[x],{x,-Infinity,+Infinity}]
>Returns the correct value of 1.
>
>NIntegrate[f[x],{x,-Infinity,+Infinity}]
>Returns a somewhat correct value of 1.00121
>
>Integrate[f[x],{x,-Infinity,0}]
>Returns a "System`\$\$Failure" term
>
>NIntegrate[f[x],{x,-Infinity,0}]
>Returns a 7.6E-24 which is incorrect
>
>Integrate[f[x],{x,0,+Infinity}]
>Returns a "System`\$\$Failure" term
>
>NIntegrate[f[x],{x,0,+Infinity}]
>Returns an incorrect value of 1.00121
>
>I need to obtain numerical values from these and similar calculations
>and suspect that some options need to be changed. Symbolic solutions
>would be preferred if possible. Are there guidelines that can help
>define what options for Integrate/NIntegrate work best ?
>

• Prev by Date: Display Bug
• Next by Date: Re: how to spin a ScatterPlot3D
• Previous by thread: Re: Display Bug
• Next by thread: Re: Integrate Problems