On Tuesday 02 December 2008 09:58:52 Fabian Seoane wrote:
> +1. I'll push this when you post the test
>
> Thanks,
>

Here is two simple tests, thanks!

Cheers,
Riccardo

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"sympy-patches" group.
To post to this group, send email to sympy-patches@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/sympy-patches?hl=en
-~----------~----~----~----~------~----~------~--~---

From a056f3e50c3af8dfc206b431b0420bd02b69440b Mon Sep 17 00:00:00 2001
From: Riccardo Gori <[EMAIL PROTECTED]>
Date: Tue, 2 Dec 2008 14:46:29 +0100
Subject: [PATCH] Tests for Normal.pdf

---
 sympy/statistics/tests/test_statistics.py |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)

diff --git a/sympy/statistics/tests/test_statistics.py b/sympy/statistics/tests/test_statistics.py
index 393ece7..157f090 100644
--- a/sympy/statistics/tests/test_statistics.py
+++ b/sympy/statistics/tests/test_statistics.py
@@ -1,4 +1,4 @@
-from sympy import sqrt, Rational, oo, Symbol, exp
+from sympy import sqrt, Rational, oo, Symbol, exp, pi
 from sympy.functions import erf
 from sympy.statistics import Normal, Uniform
 from sympy.statistics.distributions import PDF
@@ -19,10 +19,13 @@ def test_normal():
     assert N.variance == 16
     assert N.confidence(1) == (-oo, oo)
     assert N.probability(1, 3) == erf(1/sqrt(32))
+    assert N.pdf(1).evalf() == (exp(Rational(-1,32)) / (4*sqrt(2*pi))).evalf()
     for p in [0.1, 0.3, 0.7, 0.9, 0.995]:
         a, b = N.confidence(p)
         assert operator.abs(float(N.probability(a, b).evalf()) - p) < 1e-10
 
+    N = Normal(0, 2/sqrt(2*pi))
+    assert N.pdf(0) == Rational(1,2)
     mp.dps = dps
 
 def test_uniform():
-- 
1.5.6.4

Reply via email to