Dear Wiki user, You have subscribed to a wiki page or wiki category on "Couchdb Wiki" for change notification. The following page has been changed by MarcaJames: http://wiki.apache.org/couchdb/View_Snippets The comment on the change is: small spelling and typo corrections, and added my name to my contribution ------------------------------------------------------------------------------ == Computing simple summary statistics (min,max,mean,standard deviation) == + + Implementation in {{{JavaScript}}} by MarcaJames. Mistakes in coding are my fault, algorithms are from others, as noted. To the best of my knowledge the algorithms are public domain, and my implementation freely available to all (Perl Artistic License if you really need a license to consult) Here is some code I have developed to compute standard deviation. I do it two ways, both of which are different from jchris' github version (add link?). In practice of course you wouldn't need both ways. The view is specialized to my dataset, but the reduce function might be useful to others. @@ -244, +246 @@ // Computer Science, Stanford University, November 1979. url: // ftp://reports.stanford.edu/pub/cstr/reports/cs/tr/79/773/CS-TR-79-773.pdf - // so there is some wierdness in that the original was Fortran, index from 1, + // so there is some weirdness in that the original was Fortran, index from 1, // and lots of arrays (no lists, no hash tables) @@ -318, +320 @@ The fifth parameter is for the running min, and the sixth for the max. - Pass for parameters 2 through 6 if you need to pass a key in the + Pass "null" for parameters 2 through 6 if you need to pass a key in the seventh slot. Some notes on the algorithm. There is a precious bit of trickery @@ -445, +447 @@ The first parameter is again values, a list of objects with the expectation that the variable of interest is contained under the key 'risk'. If this is not the case, pass the correct variable in the 7th field. - Parameters 2 through 6 are all optional. Pass nulls if you need to pass a key. + Parameters 2 through 6 are all optional. Pass nulls if you need to pass a key in slot 7. In order they are