[Biopython-dev] [Bug 2657] Improved Bio/Statistics/lowess.py

bugzilla-daemon at portal.open-bio.org bugzilla-daemon at portal.open-bio.org
Fri Nov 14 11:35:44 UTC 2008


http://bugzilla.open-bio.org/show_bug.cgi?id=2657





------- Comment #7 from eric.pruitt at gmail.com  2008-11-14 06:35 EST -------
(In reply to comment #6)
> (In reply to comment #4)
> > Created an attachment (id=1058)
 --> (http://bugzilla.open-bio.org/attachment.cgi?id=1058&action=view) [details] [details]
> > Unit test for lowess.py
> > 
> > File will need to have the import statements adjsuted for the Bio.Python
> > structure.
> > 
> 
> You're also using scipy and rpy (not Biopython dependencies), so if we wanted
> to include these tests they would have to be made conditional on these external
> dependencies (so that the test framework knows when it can skip them).  
> 
> Removing them effectivly leaves one simple test:
> 
> from numpy import array
> from Bio.Statistics.lowess import lowess
> 
> hand_iterations = 1
> hand_f = 2./3.
> hand_x = array([0.0,1.0,4.0,7.0])
> hand_y = array([0.0,1.0,16.0,49.0])
> #Was there a typo in the original, 18.85086... versus 18.5086...?
> #hand_out = [-1.333391371257, 2.802858739, 18.850860916, 48.302727]
> hand_out = [ -1.33338941,   2.80323154,  18.50860916,  48.30274834]
> method_out = lowess(hand_x,hand_y,hand_f,hand_iterations)
> for a,b in zip(method_out, hand_out) :
>     assert abs(a-b) < 0.00001
> print "Done"
> 

When I did the hand calculations, I used a TI-84+ which uses decimal math
eliminating the binary error inherent in most python implementations.


-- 
Configure bugmail: http://bugzilla.open-bio.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.



More information about the Biopython-dev mailing list