[SciPy-dev] Two new test failures

Christopher Hanley chanley@stsci....
Thu Nov 13 10:35:14 CST 2008


josef.pktd@gmail.com wrote:
> Hi,
> 
> I ran the test 10,15 times and I never get a failure with nbinom. I'm
> working with numpy 1.2.1 on Windows XP, and I don't know which part of
> the test causes the failure.
> 
> Would you please run the attached test file with nosetests -v -s and
> post the output? It is the same test as in trunk but running only
> nbinom with debug printout, and runs pretty fast.
> 
> To get a quick check on the random number generator you could also check:
> 
>>>> stats.nbinom.stats(5,0.5)
> (array(5.0), array(10.0))
>>>> rvs = np.random.negative_binomial(5, 0.5, 1000000)
>>>> rvs.mean()
> 5.0053890000000001
>>>> rvs.var()
> 10.016529958705213
> 
> Thanks for the help,
> 
> Josef
> 
> 
> ------------------------------------------------------------------------
> 
> _______________________________________________
> Scipy-dev mailing list
> Scipy-dev@scipy.org
> http://projects.scipy.org/mailman/listinfo/scipy-dev
Sure thing:

[redcedar:~/dev/devCode] chanley% nosetests -v -s 
test_discrete_chisquare.py
nbinom
test_discrete_chisquare.test_discrete_rvs_cdf('nbinom', (5, 0.5)) ... 
/Users/chanley/dev/site-packages/lib/python/numpy/lib/function_base.py:325: 
Warning:
             The new semantics of histogram is now the default and the 
`new`
             keyword will be removed in NumPy 1.4.

   """, Warning)
chis,pval: 14.4736379946 0.152462703179
len(distsupp), len(distmass), len(hsupp), len(freq)
12 11 12 11
distsupp [  0.   1.   2.   3.   4.   5.   6.   7.   8.  10.  15.  Inf]
distmass [ 5468.75        5859.375       6835.9375      6835.9375 
6152.34375
   5126.953125    4028.3203125   3021.24023438  3709.41162109  2666.28265381
    295.44830322]
freq [5504 5814 6930 6969 6102 5041 3925 3098 3748 2591  278]
itemfreq [[  0.00000000e+00   1.56800000e+03]
  [  1.00000000e+00   3.93600000e+03]
  [  2.00000000e+00   5.81400000e+03]
  [  3.00000000e+00   6.93000000e+03]
  [  4.00000000e+00   6.96900000e+03]
  [  5.00000000e+00   6.10200000e+03]
  [  6.00000000e+00   5.04100000e+03]
  [  7.00000000e+00   3.92500000e+03]
  [  8.00000000e+00   3.09800000e+03]
  [  9.00000000e+00   2.22600000e+03]
  [  1.00000000e+01   1.52200000e+03]
  [  1.10000000e+01   1.00400000e+03]
  [  1.20000000e+01   6.87000000e+02]
  [  1.30000000e+01   4.48000000e+02]
  [  1.40000000e+01   2.81000000e+02]
  [  1.50000000e+01   1.71000000e+02]
  [  1.60000000e+01   1.15000000e+02]
  [  1.70000000e+01   6.80000000e+01]
  [  1.80000000e+01   3.60000000e+01]
  [  1.90000000e+01   2.90000000e+01]
  [  2.00000000e+01   1.30000000e+01]
  [  2.10000000e+01   7.00000000e+00]
  [  2.20000000e+01   2.00000000e+00]
  [  2.30000000e+01   5.00000000e+00]
  [  2.40000000e+01   2.00000000e+00]
  [  2.50000000e+01   1.00000000e+00]]
n*pmf [ 1562.5         3906.25        5859.375       6835.9375 
6835.9375
   6152.34375     5126.953125    4028.3203125   3021.24023437 
2182.00683594]
ok

----------------------------------------------------------------------
Ran 1 test in 0.889s

OK


-- 
Christopher Hanley
Senior Systems Software Engineer
Space Telescope Science Institute
3700 San Martin Drive
Baltimore MD, 21218
(410) 338-4338


More information about the Scipy-dev mailing list