Summary
statistics: some bugs
Metadata
- Id: 2786092eecddd302b8755cf6cb77c10419642384
- Trac id: 837
- Type: defect
- Reporter: sjamaan
- Owner: petercrlane
- Cc:
- Status: closed
- Component: extensions
- Estimated difficulty:
- Resolution: wontfix
- Priority: minor
- Milestone:
- Version: 4.7.x
- Changetime: 2015-09-21 15:06:42 UTC
- Created: 2012-05-13 16:28:05 UTC
- Keywords:
Attachments
- 2786092eecddd302b8755cf6cb77c10419642384/attachments/scrutiny-fixes.patch
Description
The scrutinizer found a few bugs in statistics (see http://tests.call-cc.org/master/linux/x86/2012/05/12/salmonella-report/install/statistics.html). The first one in wilcoxon-signed-rank-test initially looked like a simple mistake of swapping the arguments to list-ref, but even after fixing that I was unable to get it to do anything but error out.
#1;> (use statistics srfi-1) #2;> (wilcoxon-signed-rank-test (iota 17)) ;; ERROR
After adding some debugging code, it looks like the indexes are wrong; last is determined counting from the end of the list, but it *looks* like the code is treating it as if it's counted from the front. After changing that accordingly I still kept getting errors, so I'll leave that to you. I decided to let my patch simply fix these warnings and nothing more.
The second message about wilcoxon-signed-rank-test refers to the fact that var-r1 is being applied as if it were a procedure. However, it's just a number, so this would fail.
The warning about mcnemars-test is due to the fact that the return value of set! is undefined in Scheme (this is different from Common Lisp, where setf returns the last value set, I think). I don't really understand the purpose of the named let, so I didn't touch it (instead just doing a simple transformation that's always safe), but it really looks like it doesn't do anything at all.
Attached is a patch that gets rid of these warnings.
Changes and comments
[2012-05-13 16:28:15 UTC] sjamaan attached scrutiny-fixes.patch (description=#f)
[2012-05-13 16:28:52 UTC] sjamaan changed description
[2015-09-21 15:06:42 UTC] sjamaan changed status from new to closed
[2015-09-21 15:06:42 UTC] sjamaan set resolution to wontfix
[2015-09-21 15:06:42 UTC] sjamaan wrote:
Unmaintained egg