header image

Testing the statistics functions

Posted by: | July 14, 2011 | No Comment |

To enable repeatable testing of the statistical functions I’m creating I decided to create a test script.

$data1 = @(1,2,3,4,5,6,7,8,9,10)            
$data2 = @(21,22,23,24,25,26,27,28,29,30)            
get-mean -numbers $data1            
get-mean -numbers $data2            
get-standarddeviation -numbers $data1            
get-standarddeviation -numbers $data2            
get-correlation -numbers1 $data1 -numbers2 $data2

As it always uses the same values and calls the functions in the same way I can generate repeatable results.


I’ll add extra lines to the script as I add more functions

under: Math, PowerShellV2