﻿id	summary	reporter	owner	description	type	status	priority	milestone	component	version	resolution	keywords	cc	difficulty
837	statistics: some bugs	sjamaan	petercrlane	"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."	defect	closed	minor		extensions	4.7.x	wontfix			
