Integrating Normal Distributions gives the wrong answer
- To: mathgroup at yoda.physics.unc.edu
- Subject: Integrating Normal Distributions gives the wrong answer
- From: mek at guinan.psu.edu (Mark E. Kotanchek)
- Date: Tue, 8 Sep 92 16:58:04 EDT
I was intending to as y'all about the suitability of running Mma 2.1 on a
Mac Powerbook 170 since I was working at home over the weekend trying to
figure out convergence rates of covariance matrices; alas, now that I'm
playing with Mma 2.0 on my office NeXTstation, I'm wondering whether I
should spring for Maple and avoid the "beautifully formatted, incorrect
answers" syndrome which my colleague is chortling about at the moment.
The issue is integrating normal distribution functions. Given that I define
the Gaussian density function,
f=Exp[-(x-mu)^2/(2 sigma^2)]/(sigma Sqrt[2 Pi])
which gives me
1
---------------------------------------
2 2
(-mu + x) /(2 sigma )
E Sqrt[2 Pi] sigma
upon integrating from negative to positive infinity I should get a result of
1. Instead Mathematica assures me that the answer is zero!!
Integrate[f,{x,-Infinity,Infinity}]
0
Setting mu = 0 leads to the result,
mu=0;
Integrate[f,{x,-Infinity,Infinity}]
sigma
----------
Abs[sigma]
which, is closer and presumably Mathematica would give me the correct result
if I knew how to tell Mathematica that sigma is always non-negative. (A
feature which I'm sure must be in Mathematica but manages to elude me while
scouring Blachman's various books and Wolfram's manual--obtuse documentation
of an obtuse program overcomes me once more!)
Anyhow, is this misbehavior of Mathematica fixed in v2.1 or is there some
sort of a rationale for such behavior? It seems like I'm trying such a
simple exercise that there isn't much room for operator error....
Thanks much,
Mark.
---
Mark Kotanchek
Guidance & Control Dept - 363 ASB
Applied Research Lab/Penn State
P.O. Box 30
State College, PA 16804
e-mail: mek at guinan.psu.edu (NeXTmail)
TEL: (814)863-0682
FAX: (814)863-7843