Wanted to get the moments of a Normal distribution WRT mu and sigma, a la:
http://en.wikipedia.org/wiki/Normal_distribution#Moments
For starters, this outputs 1 for one for one crazy domains, and then leaves
the integral unevaluated on the rest of the domain. But it gets one, so I'm
cool with that.
from sympy.statistics import Normal
from sympy import symbols, integrate
f = Normal(mu, sigma).pdf(x)
x, mu, sigma = symbols('x mu sigma')
integrate(f, (x,-oo, oo))
Then when I get the first moment, it really starts to go crazy though, and
leaves it all indefinite:
integrate(f * x, (x, -oo, oo))
What approach should I take here if I wanted to get those values cited in
wikipedia? Haven't used Sympy much before. Thanks in advance.
Justin
--
You received this message because you are subscribed to the Google Groups
"sympy" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/sympy.
To view this discussion on the web visit
https://groups.google.com/d/msgid/sympy/2babc41b-0ab4-443c-a75b-d5910ce16c21%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.