JuliaLang/julia — pull request #4394 by cfbaptista (2013-09-29 03:43:36+00:00)
Title: RFC: New statistical function to compute the root mean square of data series

I have implemented two new functions to compute the root-mean-square (`rms`) of two data series. Naming two data series **s1** and **s2**, then the first `rms` function call reads:

rms(s1-s2)

In the second `rms` function, the data series are supplied separately:

rms(s1, s2)

The reason for this second function is to allow a normalisation of the root-mean-square by dividing the rms value by the range of **s2** (using an optional argument):

rms(s1, s2, 1)

The normalisation is quite important because a small rms value does not immediately imply a good fit. If the values contained in the data series are small, let's say O(-10), then a rms value of O(-9) is huge.

I have added the functions to an already existing file: `base/statistics.jl` and I have added tests to the corresponding test file: `test/statistics.jl`. Afterwards I build Julia from-source and ran `make clean testall` and everything completed succesfully.

This is my first contribution to Julia, so please feel free to indicate whether I have done something in a wrong way.