Opened 13 years ago
Last modified 10 years ago
#837 closed defect
statistics: some bugs — at Initial Version
Reported by: | sjamaan | Owned by: | petercrlane |
---|---|---|---|
Priority: | minor | Milestone: | |
Component: | extensions | Version: | 4.7.x |
Keywords: | Cc: | ||
Estimated difficulty: |
Description
The scrutinizer found a few bugs in statistics. 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.