Re: Gaussians
- To: mathgroup at yoda.ncsa.uiuc.edu
- Subject: Re: Gaussians
- From: uunet!ALLEGHENY.SCRC.Symbolics.COM!jpg
- Date: Thu, 7 Jun 90 14:08 EDT
Date: Mon, 4 Jun 90 21:58:07 PDT
From: marchett at cod.nosc.mil (David J. Marchette)
Thanks again for all those who responded to my query. Here is the
simplest solution: (Type the following into mathematica)
f[x_,s_] := Exp[-(x/s)^2/2]/(Sqrt[2 Pi] s)
Unprotect[Erf]
Erf[DirectedInfinity[1] * ___] = 1
Erf[DirectedInfinity[-1] * ___] = -1
Protect[Erf]
Integrate[f[x,sigma],{x,-Infinity,Infinity}]
(* Yay! *)
Integrate[f[x,sigma]^2,{x,-Infinity,Infinity}]
(* Yay! *)
Integrate[f[x,sigma1] f[x,sigma2],{x,-Infinity,Infinity}]
(* Boo! *)
As you can see, if you did the above, it's still hosed. Now it seems that
I need to tell it that Sqrt[-x] I is -Sqrt[x], and whatall. It is pretty clear
that in order to do what I want, I have to know much more about Mathematica.
Does anyone out there have access to Macsyma or Maple? Do these also
choke on this?
Since you ask, MACSYMA has no trouble with this. I typed in the problem as you
first posed it:
(C1) assume(sigma>0)$
(C2) integrate(exp(-x^2/(2*sigma^2)),x,-inf,inf);
(D2) sqrt(2) sqrt(%pi) sigma
(C3) (forget(sigma>0),assume(sigma<0))$
(C4) integrate(exp(-x^2/(2*sigma^2)),x,-inf,inf);
(D4) - sqrt(2) sqrt(%pi) sigma
I'm not saying that Mathematica is wrong, mind you, it's
just not giving me what I want. Am I too demanding?
I don't think so.
Jeffrey P. Golden
Symbolics MACSYMA Division
jpg at ALLEGHENY.SCRC.Symbolics.COM