diff --git a/data/numpy/CorrNumpyData_pwm.csv b/data/numpy/CorrNumpyData_pwm.csv
index 35a9817a..d12bb99a 100644
--- a/data/numpy/CorrNumpyData_pwm.csv
+++ b/data/numpy/CorrNumpyData_pwm.csv
@@ -1,38 +1,39 @@
+1.000000000000000000, 1.000000000000000000
1.000000000000000000, 0.660156250000000000
1.000000000000000000, 0.414062500000000000
1.000000000000000000, 0.292968750000000000
1.000000000000000000, 0.250000000000000000
-1.000000000000000000, 0.261718750000000000
+-1.000000000000000000, 0.261718750000000000
-1.000000000000000000, 0.312500000000000000
-1.000000000000000000, 0.488281250000000000
-1.000000000000000000, 0.742187500000000000
--1.000000000000000000, 0.722656250000000000
+1.000000000000000000, 0.722656250000000000
1.000000000000000000, 0.523437500000000000
1.000000000000000000, 0.355468750000000000
1.000000000000000000, 0.296875000000000000
1.000000000000000000, 0.285156250000000000
1.000000000000000000, 0.304687500000000000
-1.000000000000000000, 0.394531250000000000
+-1.000000000000000000, 0.394531250000000000
-1.000000000000000000, 0.585937500000000000
-1.000000000000000000, 0.683593750000000000
--1.000000000000000000, 0.554687500000000000
+1.000000000000000000, 0.554687500000000000
1.000000000000000000, 0.402343750000000000
1.000000000000000000, 0.296875000000000000
1.000000000000000000, 0.269531250000000000
1.000000000000000000, 0.304687500000000000
1.000000000000000000, 0.371093750000000000
-1.000000000000000000, 0.460937500000000000
+-1.000000000000000000, 0.460937500000000000
-1.000000000000000000, 0.496093750000000000
--1.000000000000000000, 0.507812500000000000
+1.000000000000000000, 0.507812500000000000
1.000000000000000000, 0.402343750000000000
1.000000000000000000, 0.312500000000000000
1.000000000000000000, 0.269531250000000000
1.000000000000000000, 0.289062500000000000
1.000000000000000000, 0.339843750000000000
1.000000000000000000, 0.390625000000000000
-1.000000000000000000, 0.386718750000000000
+-1.000000000000000000, 0.386718750000000000
-1.000000000000000000, 0.453125000000000000
--1.000000000000000000, 0.339843750000000000
+1.000000000000000000, 0.339843750000000000
1.000000000000000000, 0.265625000000000000
1.000000000000000000, 0.207031250000000000
1.000000000000000000, 0.242187500000000000
@@ -48,8 +49,8 @@
1.000000000000000000, 0.234375000000000000
1.000000000000000000, 0.222656250000000000
1.000000000000000000, 0.242187500000000000
-1.000000000000000000, 0.269531250000000000
--1.000000000000000000, 0.187500000000000000
+-1.000000000000000000, 0.269531250000000000
+1.000000000000000000, 0.187500000000000000
1.000000000000000000, 0.097656250000000000
1.000000000000000000, 0.101562500000000000
1.000000000000000000, 0.167968750000000000
@@ -82,94 +83,94 @@
1.000000000000000000, -0.117187500000000000
1.000000000000000000, -0.097656250000000000
1.000000000000000000, -0.015625000000000000
-1.000000000000000000, 0.074218750000000000
--1.000000000000000000, -0.039062500000000000
+-1.000000000000000000, 0.074218750000000000
+1.000000000000000000, -0.039062500000000000
1.000000000000000000, -0.128906250000000000
1.000000000000000000, -0.171875000000000000
1.000000000000000000, -0.183593750000000000
1.000000000000000000, -0.195312500000000000
1.000000000000000000, -0.175781250000000000
1.000000000000000000, -0.093750000000000000
-1.000000000000000000, -0.003906250000000000
--1.000000000000000000, 0.007812500000000000
+-1.000000000000000000, -0.003906250000000000
+1.000000000000000000, 0.007812500000000000
1.000000000000000000, -0.128906250000000000
1.000000000000000000, -0.218750000000000000
1.000000000000000000, -0.230468750000000000
1.000000000000000000, -0.242187500000000000
1.000000000000000000, -0.222656250000000000
1.000000000000000000, -0.171875000000000000
-1.000000000000000000, -0.082031250000000000
+-1.000000000000000000, -0.082031250000000000
-1.000000000000000000, -0.015625000000000000
--1.000000000000000000, -0.128906250000000000
+1.000000000000000000, -0.128906250000000000
1.000000000000000000, -0.234375000000000000
1.000000000000000000, -0.292968750000000000
1.000000000000000000, -0.304687500000000000
1.000000000000000000, -0.253906250000000000
1.000000000000000000, -0.203125000000000000
-1.000000000000000000, -0.144531250000000000
+-1.000000000000000000, -0.144531250000000000
-1.000000000000000000, -0.078125000000000000
--1.000000000000000000, -0.066406250000000000
+1.000000000000000000, -0.066406250000000000
1.000000000000000000, -0.203125000000000000
1.000000000000000000, -0.308593750000000000
1.000000000000000000, -0.335937500000000000
1.000000000000000000, -0.285156250000000000
1.000000000000000000, -0.234375000000000000
-1.000000000000000000, -0.175781250000000000
+-1.000000000000000000, -0.175781250000000000
-1.000000000000000000, -0.140625000000000000
-1.000000000000000000, -0.105468750000000000
--1.000000000000000000, -0.187500000000000000
+1.000000000000000000, -0.187500000000000000
1.000000000000000000, -0.292968750000000000
1.000000000000000000, -0.367187500000000000
1.000000000000000000, -0.316406250000000000
1.000000000000000000, -0.250000000000000000
-1.000000000000000000, -0.191406250000000000
+-1.000000000000000000, -0.191406250000000000
-1.000000000000000000, -0.156250000000000000
-1.000000000000000000, -0.121093750000000000
-1.000000000000000000, -0.125000000000000000
--1.000000000000000000, -0.253906250000000000
+1.000000000000000000, -0.253906250000000000
1.000000000000000000, -0.359375000000000000
1.000000000000000000, -0.339843750000000000
-1.000000000000000000, -0.281250000000000000
+-1.000000000000000000, -0.281250000000000000
-1.000000000000000000, -0.214843750000000000
-1.000000000000000000, -0.179687500000000000
-1.000000000000000000, -0.144531250000000000
-1.000000000000000000, -0.140625000000000000
--1.000000000000000000, -0.207031250000000000
+1.000000000000000000, -0.207031250000000000
1.000000000000000000, -0.312500000000000000
1.000000000000000000, -0.324218750000000000
-1.000000000000000000, -0.265625000000000000
+-1.000000000000000000, -0.265625000000000000
-1.000000000000000000, -0.230468750000000000
-1.000000000000000000, -0.195312500000000000
-1.000000000000000000, -0.160156250000000000
-1.000000000000000000, -0.156250000000000000
-1.000000000000000000, -0.152343750000000000
--1.000000000000000000, -0.250000000000000000
+1.000000000000000000, -0.250000000000000000
1.000000000000000000, -0.292968750000000000
-1.000000000000000000, -0.265625000000000000
+-1.000000000000000000, -0.265625000000000000
-1.000000000000000000, -0.230468750000000000
-1.000000000000000000, -0.195312500000000000
-1.000000000000000000, -0.160156250000000000
-1.000000000000000000, -0.156250000000000000
-1.000000000000000000, -0.152343750000000000
--1.000000000000000000, -0.203125000000000000
+1.000000000000000000, -0.203125000000000000
1.000000000000000000, -0.230468750000000000
-1.000000000000000000, -0.234375000000000000
+-1.000000000000000000, -0.234375000000000000
-1.000000000000000000, -0.199218750000000000
-1.000000000000000000, -0.195312500000000000
-1.000000000000000000, -0.160156250000000000
-1.000000000000000000, -0.156250000000000000
-1.000000000000000000, -0.152343750000000000
-1.000000000000000000, -0.148437500000000000
--1.000000000000000000, -0.183593750000000000
-1.000000000000000000, -0.187500000000000000
+1.000000000000000000, -0.183593750000000000
+-1.000000000000000000, -0.187500000000000000
-1.000000000000000000, -0.183593750000000000
-1.000000000000000000, -0.179687500000000000
-1.000000000000000000, -0.144531250000000000
-1.000000000000000000, -0.140625000000000000
-1.000000000000000000, -0.136718750000000000
-1.000000000000000000, -0.132812500000000000
--1.000000000000000000, -0.167968750000000000
-1.000000000000000000, -0.171875000000000000
+1.000000000000000000, -0.167968750000000000
+-1.000000000000000000, -0.171875000000000000
-1.000000000000000000, -0.136718750000000000
-1.000000000000000000, -0.132812500000000000
-1.000000000000000000, -0.128906250000000000
@@ -202,8 +203,8 @@
-1.000000000000000000, -0.023437500000000000
-1.000000000000000000, -0.019531250000000000
-1.000000000000000000, -0.015625000000000000
--1.000000000000000000, -0.050781250000000000
-1.000000000000000000, -0.101562500000000000
+1.000000000000000000, -0.050781250000000000
+-1.000000000000000000, -0.101562500000000000
-1.000000000000000000, -0.113281250000000000
-1.000000000000000000, -0.062500000000000000
-1.000000000000000000, -0.011718750000000000
@@ -219,38 +220,37 @@
-1.000000000000000000, 0.027343750000000000
-1.000000000000000000, 0.031250000000000000
-1.000000000000000000, 0.035156250000000000
--1.000000000000000000, 0.015625000000000000
+1.000000000000000000, 0.015625000000000000
1.000000000000000000, -0.042968750000000000
-1.000000000000000000, -0.093750000000000000
+-1.000000000000000000, -0.093750000000000000
-1.000000000000000000, -0.074218750000000000
-1.000000000000000000, -0.054687500000000000
-1.000000000000000000, -0.003906250000000000
-1.000000000000000000, 0.031250000000000000
-1.000000000000000000, 0.035156250000000000
-1.000000000000000000, 0.039062500000000000
--1.000000000000000000, 0.003906250000000000
+1.000000000000000000, 0.003906250000000000
1.000000000000000000, -0.039062500000000000
-1.000000000000000000, -0.074218750000000000
+-1.000000000000000000, -0.074218750000000000
-1.000000000000000000, -0.070312500000000000
-1.000000000000000000, -0.035156250000000000
-1.000000000000000000, 0.000000000000000000
-1.000000000000000000, 0.035156250000000000
-1.000000000000000000, 0.039062500000000000
--1.000000000000000000, 0.035156250000000000
+1.000000000000000000, 0.035156250000000000
1.000000000000000000, 0.007812500000000000
1.000000000000000000, -0.019531250000000000
-1.000000000000000000, -0.039062500000000000
+-1.000000000000000000, -0.039062500000000000
-1.000000000000000000, -0.050781250000000000
-1.000000000000000000, -0.031250000000000000
-1.000000000000000000, -0.011718750000000000
-1.000000000000000000, 0.007812500000000000
-1.000000000000000000, 0.027343750000000000
--1.000000000000000000, 0.023437500000000000
+1.000000000000000000, 0.023437500000000000
1.000000000000000000, 0.011718750000000000
1.000000000000000000, 0.000000000000000000
1.000000000000000000, -0.011718750000000000
-1.000000000000000000, -0.015625000000000000
+-1.000000000000000000, -0.015625000000000000
-1.000000000000000000, -0.011718750000000000
-1.000000000000000000, -0.007812500000000000
-1.000000000000000000, -0.003906250000000000
--1.000000000000000000, 0.000000000000000000
diff --git a/data/numpy/CorrNumpyData_rnd.csv b/data/numpy/CorrNumpyData_rnd.csv
index dd70c0e8..61169fcd 100644
--- a/data/numpy/CorrNumpyData_rnd.csv
+++ b/data/numpy/CorrNumpyData_rnd.csv
@@ -1,256 +1,256 @@
-1.331586504129518067, 0.002952952054800384
-0.715278974398405487, -0.020666510216162885
--1.545400292111268170, -0.038296946319570979
--0.008383849928522256, -0.071018020658846839
-0.621335973890480453, 0.033393210770982090
--0.720085560718896844, 0.009802139946380817
-0.265511585692119523, -0.027980653239683993
-0.108548525714969438, -0.159170817023096572
-0.004291430934033236, -0.091179278654325221
--0.174600210592941285, 0.047211692308566873
-0.433026189953597984, 0.068144342871753402
-1.203037373812211985, -0.026610308604003891
--0.965065670516763285, 0.000978353402469867
-1.028274077982703982, 0.011381406159276247
-0.228630130124659686, 0.017331665483869597
-0.445137612830347862, 0.048540248223967977
--1.136602211831044151, 0.064762985694065259
-0.135136878448635506, -0.024232964762146640
-1.484537001836582215, -0.099565184195362325
--1.079804885785276003, -0.068361380861822627
--1.977728280657907067, -0.016352980708580402
--1.743372295898907298, 0.059448603290515073
-0.266070164000551002, -0.033454631167549195
-2.384967330711096789, 0.113824285476820233
-1.123691253409423441, -0.077688040547927703
-1.672622213307827677, -0.041154419258984450
-0.099149215835243623, 0.021757124172020872
-1.397996377093575271, 0.039333206132649609
--0.271247987965780812, -0.033700534001890770
-0.613204184859639123, -0.003088327039459093
--0.267317188673568629, -0.079718954138139828
--0.549309014105478943, 0.020569988090213338
-0.132708295759951189, 0.092094542017921777
--0.476142014927337098, 0.024114827379852634
-1.308473080863477689, 0.080937875538076645
-0.195013279233092807, -0.120057506504129954
-0.400209988252348214, -0.024332029761024179
--0.337632337085530976, 0.078460505859585472
-1.256472263755155527, -0.008271484726600997
--0.731969502001207917, 0.016134830963251755
-0.660231551226313162, -0.050118389942772491
--0.350871891439871297, -0.083251189423861269
--0.939433359762551157, 0.052937694717175375
--0.489337216884651593, -0.078055425207703005
--0.804591142269954540, 0.024354550395062281
--0.212697638710511755, 0.062319019404535388
--0.339140246063434680, -0.085837938851925019
-0.312169936313222096, 0.092227594101710442
-0.565152669656627360, 0.027172021333630923
--0.147420257727019860, 0.088682102236516597
--0.025905336816186168, -0.031645255816863602
-0.289094203803934968, -0.062780930577393840
--0.539879071332701188, -0.058890628164904785
-0.708160019926603490, -0.061725882396194039
-0.842224738382655658, 0.021981002666366066
-0.203580797327478663, 0.011310894007175156
-2.394703664884535232, 0.033543044260846290
-0.917458937510429284, 0.016203199433179532
--0.112272471194160034, -0.028290955374876785
--0.362180447142240070, -0.033558811478749284
--0.232182255944090921, -0.026356679567516875
--0.501728899594867217, 0.058217670877127731
-1.128785153109877371, -0.026233010472815468
--0.697810030471714637, -0.000389694593526376
--0.081122183816946136, -0.001269893814222131
--0.529296080999488217, -0.003213919083752651
-1.046182856808264283, 0.006729329318339875
--1.418556029223394743, 0.011867567695496640
--0.362499183155640781, -0.040889151801128461
--0.121905691161888499, 0.066001907129247389
-0.319356421091223974, -0.010237395575977916
-0.460902901671718324, 0.064325170446700206
--0.215789892330521871, 0.078819710889550865
-0.989072457499439062, 0.023712552259134725
-0.314753778811733609, -0.056647849658090249
-2.467651056434602808, -0.029312571336114555
--1.508321487163215791, 0.070424160362686089
-0.620600663008613274, -0.048419136151386211
--1.045132537514437576, -0.024827520062386116
--0.798008817672244186, 0.038406951708962377
-1.985084591425731126, 0.012725544345954987
-1.744814148339301152, -0.012166498031226776
--1.856185480611147964, 0.102808738641267050
--0.222773699102999656, -0.083504168856511504
--0.065847847711201168, -0.064253935312282656
--2.131712108481603973, -0.020449917491753424
--0.048830511338753067, -0.040340306783266229
-0.393341217081739747, 0.066496463499133296
-0.217265145118039599, 0.034356629323451793
--1.994393769741057421, -0.069172466844050526
-1.107708234782649681, -0.020356062708239375
-0.244543976647989714, -0.037949492363549581
--0.061912029492404284, -0.057444315048432740
--0.753892960747699292, 0.016407863584748036
-0.711959016519839616, -0.001975781185568341
-0.918269151479415457, 0.017243210633374417
--0.482093138835478996, 0.018563919840306711
-0.089587612589516127, 0.024019888942140681
-0.826998622662265093, 0.042900265877136190
--1.954512120001505204, 0.011128885426861497
-0.117475661026638187, 0.042394444183627068
--1.907456888124400285, -0.069792318369670356
--0.922909264848945976, 0.053169550131311347
-0.469751434083042929, 0.029504652777701951
--0.144366763026963690, -0.016919432362360844
--0.400138351985728502, -0.021971797057278648
--0.295983852939212144, -0.047284884323214982
-0.848208609021656290, -0.093737147888054581
-0.706830454751634973, 0.030179164925693076
--0.787268926247186696, 0.034894244491379858
-0.292940724831966870, 0.030127910693944208
--0.470807251485517275, 0.016832103872012890
-2.404325605937349675, 0.020904662874600553
--0.739356738508672007, -0.036578415168621321
--0.312828757337089591, 0.060658117875791992
--0.348881918217493203, -0.018822098341498193
--0.439026236220014299, -0.034613782749895974
-0.141104168064431934, -0.075921428460802687
-0.273049320095310910, -0.071579123772515102
--1.618570747815794908, 0.044194086492829125
--0.573113361559589696, 0.020859552483478830
--1.320447545891455743, 0.040830068265616720
-1.236205326186815778, 0.043052928819869295
-2.465325082061476270, -0.005533530073188810
-1.383232229535518387, 0.047346950268160583
-0.346233115351183174, 0.060534799231063051
-1.022516107234136218, 0.091740502731441798
-0.166810267019732478, 0.003726247719202870
-1.656716624478291822, -0.015962225918099534
-0.667889608833442283, -0.061115249383434773
--0.229946643774722848, 0.054098221515577201
--1.129551194433791483, -0.058135441519264003
--0.639962604228497711, -0.032857235022103179
-0.313830521559005871, -0.010697337882584675
--1.225835980738054776, -0.052880826862201399
--0.221793136399493940, -0.036647318972592012
-1.339926309957553352, 0.024511756805139236
-0.029309710943169753, 0.101894446070433922
-1.985385746089388670, 0.016396477111217188
-1.447165600668222307, -0.052684103228340905
--0.287629413650580701, 0.011550207880150629
--1.359310573105999342, -0.011216538514081891
--0.048041325229420673, -0.035154221158206475
--0.480787340132024010, 0.080311850866555040
-0.377753085965341906, 0.047399324046116381
-1.614407974145464886, -0.050440938797448306
--1.123104035224383068, -0.006885821955150978
--0.388727946854811268, 0.015410967207041191
-0.332349949531516753, 0.010766811712941372
-1.134973173081905706, -0.005730376530662188
-0.510714411397862778, 0.026005635911559698
-0.414297641194009303, -0.061227901285923515
-1.344549423365940966, -0.007338561514186893
-0.493515317248288621, -0.009001668284476596
--0.237004184523481071, 0.038609566793398144
-0.057285150156018080, -0.062208502501358925
--0.707071447067163850, -0.034430584314774582
-0.546664837534534431, 0.055608759071560175
-0.942500408940140200, 0.009547199149154790
--2.979596771061133964, 0.043677632154964834
-1.218148850351047363, 0.049173620489751449
--0.056520723082590520, 0.032084477178946580
-0.460888452398865944, -0.037430608850803460
-0.662374011724633061, -0.020852535800928686
--2.295103328962623479, 0.006294006446293058
--1.195929311463517664, 0.008326364738533598
--0.333101162137835027, -0.040755750258626086
--0.791390770967443813, 0.010613292885854220
-0.274172780760106816, -0.027181360411020660
--0.514909922471251780, -0.083868778458025761
--1.711071197154264478, 0.040493991317517311
-0.612297312498550350, 0.005810130551395069
-1.100129374013328665, 0.044417699564590830
-0.564352526386117992, -0.011277744263183584
--0.712799436827059818, 0.007766273344625222
--0.260859478554175017, -0.016128422765080246
-0.548428066295824745, 0.013843619797221707
-0.603199050230591838, 0.015332413206831390
-1.006861138624822516, -0.020294154361450743
--0.294426007389942845, -0.020126735317792452
--1.420880515154234303, -0.045396008231542571
--0.678946774620040938, -0.033730617586296557
-0.533884809310875008, 0.048222470407476702
-0.743974403785924387, 0.019241624154398757
-2.225049638823194620, 0.009881227089014767
-0.117181420194483174, -0.042295138754657319
-0.244614520264990143, -0.034848709462126357
--0.177298822645567483, 0.023358553381504204
--0.405729527649092037, -0.009057362561265733
-0.781775190375615048, -0.012493381107678204
-0.353477613803849955, -0.056882295258989621
--0.207279485721437756, 0.013146338677855663
--1.079697383958848622, 0.024788706730146343
--0.123069828510139923, 0.014344661928147116
--0.390982185306403496, 0.035695029379350492
-1.255173731709571472, -0.015093979964307228
-0.947126078175187569, 0.015260858401754816
--1.022310692277394795, -0.009730128162977582
-1.167168368404117418, 0.006597058411930827
--0.571976813287766506, 0.012968276327588422
-0.133137496871057998, 0.018417601328128461
-1.202743873969904786, -0.010932743488860365
--1.024752967045283736, 0.001855675286687049
-0.160399162942558765, -0.008545401939341210
--1.130475287139340868, -0.031984140191515145
--1.941299681022427892, 0.001135931773238158
-0.986597816897997637, 0.012960872331512266
-0.028227367299119867, 0.009869776766370953
--0.822367597830664820, -0.032686015797210553
--1.586551760847848547, 0.011573284974931243
--0.401472819371720691, 0.016705938093584876
-1.342179284255024863, -0.013997580772508940
-0.402469093488447394, -0.040620051897172722
--0.372761416436867332, 0.011564110359900735
--0.672023436468345947, -0.028577914645039958
-0.105812082795755394, -0.020860510195761930
--1.547305390917529166, -0.011689801527661112
-1.344806510628230312, -0.007729994085476341
-0.503189181636488958, -0.021461925802754894
-1.194350602463246425, -0.031737228678191849
--0.563505671196143476, 0.056259353074332469
-0.854828756312667637, 0.003716215567109062
-0.687904725661524497, 0.014898035304375671
--1.533068718290182320, 0.022480400357681229
-0.148960700976888238, 0.002467261381077912
-0.315111168221666793, 0.014938381465601528
--0.574917664052446042, -0.024330479745003266
--0.360171134429452422, 0.019031645070517345
-0.436185296532739020, -0.056179011163483068
--0.037917882013034025, 0.007418763888180085
--1.004716352526095369, 0.035327378625718581
-0.591453086630322367, 0.003175867391865802
-0.227817363845207788, -0.008942642947578721
-0.249178657886335253, -0.030550527177720908
-0.095763236737718235, 0.027145075224174961
-0.449021730693823118, -0.018944237666366756
--0.286002007659654112, -0.007007812389638512
--0.862758299397010209, 0.021872767337605660
--0.741824838770407724, -0.013029042018477965
-1.105575136158065241, 0.004455779270249625
--2.017718652674416635, -0.000788979174155439
-0.540540713101263504, 0.010181092125864946
--1.442298882614619249, -0.021882809727335521
--1.608850362838116776, -0.003643731813531960
--1.006568561796008954, 0.016650418230563523
--0.257533624801466132, -0.013005438457614243
-0.730507447139530197, -0.009029216295337367
--1.698401491161913412, 0.010016696238474400
-1.674075545591211744, 0.010750194261019586
-1.163723700168368902, 0.000456360629852099
--0.132573592651505701, -0.004546615960266549
--0.290245808612464018, -0.003996164430531779
--0.953532417616473449, -0.005577271558238297
-0.588040593808861090, 0.004551314825040714
-0.068801470742233334, 0.007768246623261326
-1.412064304423644057, 0.000000000000000000
+1.331586504129518067, 1.000000000000000000
+0.715278974398405487, 0.002952952054800384
+-1.545400292111268170, -0.020666510216162885
+-0.008383849928522256, -0.038296946319570979
+0.621335973890480453, -0.071018020658846839
+-0.720085560718896844, 0.033393210770982090
+0.265511585692119523, 0.009802139946380817
+0.108548525714969438, -0.027980653239683993
+0.004291430934033236, -0.159170817023096572
+-0.174600210592941285, -0.091179278654325221
+0.433026189953597984, 0.047211692308566873
+1.203037373812211985, 0.068144342871753402
+-0.965065670516763285, -0.026610308604003891
+1.028274077982703982, 0.000978353402469867
+0.228630130124659686, 0.011381406159276247
+0.445137612830347862, 0.017331665483869597
+-1.136602211831044151, 0.048540248223967977
+0.135136878448635506, 0.064762985694065259
+1.484537001836582215, -0.024232964762146640
+-1.079804885785276003, -0.099565184195362325
+-1.977728280657907067, -0.068361380861822627
+-1.743372295898907298, -0.016352980708580402
+0.266070164000551002, 0.059448603290515073
+2.384967330711096789, -0.033454631167549195
+1.123691253409423441, 0.113824285476820233
+1.672622213307827677, -0.077688040547927703
+0.099149215835243623, -0.041154419258984450
+1.397996377093575271, 0.021757124172020872
+-0.271247987965780812, 0.039333206132649609
+0.613204184859639123, -0.033700534001890770
+-0.267317188673568629, -0.003088327039459093
+-0.549309014105478943, -0.079718954138139828
+0.132708295759951189, 0.020569988090213338
+-0.476142014927337098, 0.092094542017921777
+1.308473080863477689, 0.024114827379852634
+0.195013279233092807, 0.080937875538076645
+0.400209988252348214, -0.120057506504129954
+-0.337632337085530976, -0.024332029761024179
+1.256472263755155527, 0.078460505859585472
+-0.731969502001207917, -0.008271484726600997
+0.660231551226313162, 0.016134830963251755
+-0.350871891439871297, -0.050118389942772491
+-0.939433359762551157, -0.083251189423861269
+-0.489337216884651593, 0.052937694717175375
+-0.804591142269954540, -0.078055425207703005
+-0.212697638710511755, 0.024354550395062281
+-0.339140246063434680, 0.062319019404535388
+0.312169936313222096, -0.085837938851925019
+0.565152669656627360, 0.092227594101710442
+-0.147420257727019860, 0.027172021333630923
+-0.025905336816186168, 0.088682102236516597
+0.289094203803934968, -0.031645255816863602
+-0.539879071332701188, -0.062780930577393840
+0.708160019926603490, -0.058890628164904785
+0.842224738382655658, -0.061725882396194039
+0.203580797327478663, 0.021981002666366066
+2.394703664884535232, 0.011310894007175156
+0.917458937510429284, 0.033543044260846290
+-0.112272471194160034, 0.016203199433179532
+-0.362180447142240070, -0.028290955374876785
+-0.232182255944090921, -0.033558811478749284
+-0.501728899594867217, -0.026356679567516875
+1.128785153109877371, 0.058217670877127731
+-0.697810030471714637, -0.026233010472815468
+-0.081122183816946136, -0.000389694593526376
+-0.529296080999488217, -0.001269893814222131
+1.046182856808264283, -0.003213919083752651
+-1.418556029223394743, 0.006729329318339875
+-0.362499183155640781, 0.011867567695496640
+-0.121905691161888499, -0.040889151801128461
+0.319356421091223974, 0.066001907129247389
+0.460902901671718324, -0.010237395575977916
+-0.215789892330521871, 0.064325170446700206
+0.989072457499439062, 0.078819710889550865
+0.314753778811733609, 0.023712552259134725
+2.467651056434602808, -0.056647849658090249
+-1.508321487163215791, -0.029312571336114555
+0.620600663008613274, 0.070424160362686089
+-1.045132537514437576, -0.048419136151386211
+-0.798008817672244186, -0.024827520062386116
+1.985084591425731126, 0.038406951708962377
+1.744814148339301152, 0.012725544345954987
+-1.856185480611147964, -0.012166498031226776
+-0.222773699102999656, 0.102808738641267050
+-0.065847847711201168, -0.083504168856511504
+-2.131712108481603973, -0.064253935312282656
+-0.048830511338753067, -0.020449917491753424
+0.393341217081739747, -0.040340306783266229
+0.217265145118039599, 0.066496463499133296
+-1.994393769741057421, 0.034356629323451793
+1.107708234782649681, -0.069172466844050526
+0.244543976647989714, -0.020356062708239375
+-0.061912029492404284, -0.037949492363549581
+-0.753892960747699292, -0.057444315048432740
+0.711959016519839616, 0.016407863584748036
+0.918269151479415457, -0.001975781185568341
+-0.482093138835478996, 0.017243210633374417
+0.089587612589516127, 0.018563919840306711
+0.826998622662265093, 0.024019888942140681
+-1.954512120001505204, 0.042900265877136190
+0.117475661026638187, 0.011128885426861497
+-1.907456888124400285, 0.042394444183627068
+-0.922909264848945976, -0.069792318369670356
+0.469751434083042929, 0.053169550131311347
+-0.144366763026963690, 0.029504652777701951
+-0.400138351985728502, -0.016919432362360844
+-0.295983852939212144, -0.021971797057278648
+0.848208609021656290, -0.047284884323214982
+0.706830454751634973, -0.093737147888054581
+-0.787268926247186696, 0.030179164925693076
+0.292940724831966870, 0.034894244491379858
+-0.470807251485517275, 0.030127910693944208
+2.404325605937349675, 0.016832103872012890
+-0.739356738508672007, 0.020904662874600553
+-0.312828757337089591, -0.036578415168621321
+-0.348881918217493203, 0.060658117875791992
+-0.439026236220014299, -0.018822098341498193
+0.141104168064431934, -0.034613782749895974
+0.273049320095310910, -0.075921428460802687
+-1.618570747815794908, -0.071579123772515102
+-0.573113361559589696, 0.044194086492829125
+-1.320447545891455743, 0.020859552483478830
+1.236205326186815778, 0.040830068265616720
+2.465325082061476270, 0.043052928819869295
+1.383232229535518387, -0.005533530073188810
+0.346233115351183174, 0.047346950268160583
+1.022516107234136218, 0.060534799231063051
+0.166810267019732478, 0.091740502731441798
+1.656716624478291822, 0.003726247719202870
+0.667889608833442283, -0.015962225918099534
+-0.229946643774722848, -0.061115249383434773
+-1.129551194433791483, 0.054098221515577201
+-0.639962604228497711, -0.058135441519264003
+0.313830521559005871, -0.032857235022103179
+-1.225835980738054776, -0.010697337882584675
+-0.221793136399493940, -0.052880826862201399
+1.339926309957553352, -0.036647318972592012
+0.029309710943169753, 0.024511756805139236
+1.985385746089388670, 0.101894446070433922
+1.447165600668222307, 0.016396477111217188
+-0.287629413650580701, -0.052684103228340905
+-1.359310573105999342, 0.011550207880150629
+-0.048041325229420673, -0.011216538514081891
+-0.480787340132024010, -0.035154221158206475
+0.377753085965341906, 0.080311850866555040
+1.614407974145464886, 0.047399324046116381
+-1.123104035224383068, -0.050440938797448306
+-0.388727946854811268, -0.006885821955150978
+0.332349949531516753, 0.015410967207041191
+1.134973173081905706, 0.010766811712941372
+0.510714411397862778, -0.005730376530662188
+0.414297641194009303, 0.026005635911559698
+1.344549423365940966, -0.061227901285923515
+0.493515317248288621, -0.007338561514186893
+-0.237004184523481071, -0.009001668284476596
+0.057285150156018080, 0.038609566793398144
+-0.707071447067163850, -0.062208502501358925
+0.546664837534534431, -0.034430584314774582
+0.942500408940140200, 0.055608759071560175
+-2.979596771061133964, 0.009547199149154790
+1.218148850351047363, 0.043677632154964834
+-0.056520723082590520, 0.049173620489751449
+0.460888452398865944, 0.032084477178946580
+0.662374011724633061, -0.037430608850803460
+-2.295103328962623479, -0.020852535800928686
+-1.195929311463517664, 0.006294006446293058
+-0.333101162137835027, 0.008326364738533598
+-0.791390770967443813, -0.040755750258626086
+0.274172780760106816, 0.010613292885854220
+-0.514909922471251780, -0.027181360411020660
+-1.711071197154264478, -0.083868778458025761
+0.612297312498550350, 0.040493991317517311
+1.100129374013328665, 0.005810130551395069
+0.564352526386117992, 0.044417699564590830
+-0.712799436827059818, -0.011277744263183584
+-0.260859478554175017, 0.007766273344625222
+0.548428066295824745, -0.016128422765080246
+0.603199050230591838, 0.013843619797221707
+1.006861138624822516, 0.015332413206831390
+-0.294426007389942845, -0.020294154361450743
+-1.420880515154234303, -0.020126735317792452
+-0.678946774620040938, -0.045396008231542571
+0.533884809310875008, -0.033730617586296557
+0.743974403785924387, 0.048222470407476702
+2.225049638823194620, 0.019241624154398757
+0.117181420194483174, 0.009881227089014767
+0.244614520264990143, -0.042295138754657319
+-0.177298822645567483, -0.034848709462126357
+-0.405729527649092037, 0.023358553381504204
+0.781775190375615048, -0.009057362561265733
+0.353477613803849955, -0.012493381107678204
+-0.207279485721437756, -0.056882295258989621
+-1.079697383958848622, 0.013146338677855663
+-0.123069828510139923, 0.024788706730146343
+-0.390982185306403496, 0.014344661928147116
+1.255173731709571472, 0.035695029379350492
+0.947126078175187569, -0.015093979964307228
+-1.022310692277394795, 0.015260858401754816
+1.167168368404117418, -0.009730128162977582
+-0.571976813287766506, 0.006597058411930827
+0.133137496871057998, 0.012968276327588422
+1.202743873969904786, 0.018417601328128461
+-1.024752967045283736, -0.010932743488860365
+0.160399162942558765, 0.001855675286687049
+-1.130475287139340868, -0.008545401939341210
+-1.941299681022427892, -0.031984140191515145
+0.986597816897997637, 0.001135931773238158
+0.028227367299119867, 0.012960872331512266
+-0.822367597830664820, 0.009869776766370953
+-1.586551760847848547, -0.032686015797210553
+-0.401472819371720691, 0.011573284974931243
+1.342179284255024863, 0.016705938093584876
+0.402469093488447394, -0.013997580772508940
+-0.372761416436867332, -0.040620051897172722
+-0.672023436468345947, 0.011564110359900735
+0.105812082795755394, -0.028577914645039958
+-1.547305390917529166, -0.020860510195761930
+1.344806510628230312, -0.011689801527661112
+0.503189181636488958, -0.007729994085476341
+1.194350602463246425, -0.021461925802754894
+-0.563505671196143476, -0.031737228678191849
+0.854828756312667637, 0.056259353074332469
+0.687904725661524497, 0.003716215567109062
+-1.533068718290182320, 0.014898035304375671
+0.148960700976888238, 0.022480400357681229
+0.315111168221666793, 0.002467261381077912
+-0.574917664052446042, 0.014938381465601528
+-0.360171134429452422, -0.024330479745003266
+0.436185296532739020, 0.019031645070517345
+-0.037917882013034025, -0.056179011163483068
+-1.004716352526095369, 0.007418763888180085
+0.591453086630322367, 0.035327378625718581
+0.227817363845207788, 0.003175867391865802
+0.249178657886335253, -0.008942642947578721
+0.095763236737718235, -0.030550527177720908
+0.449021730693823118, 0.027145075224174961
+-0.286002007659654112, -0.018944237666366756
+-0.862758299397010209, -0.007007812389638512
+-0.741824838770407724, 0.021872767337605660
+1.105575136158065241, -0.013029042018477965
+-2.017718652674416635, 0.004455779270249625
+0.540540713101263504, -0.000788979174155439
+-1.442298882614619249, 0.010181092125864946
+-1.608850362838116776, -0.021882809727335521
+-1.006568561796008954, -0.003643731813531960
+-0.257533624801466132, 0.016650418230563523
+0.730507447139530197, -0.013005438457614243
+-1.698401491161913412, -0.009029216295337367
+1.674075545591211744, 0.010016696238474400
+1.163723700168368902, 0.010750194261019586
+-0.132573592651505701, 0.000456360629852099
+-0.290245808612464018, -0.004546615960266549
+-0.953532417616473449, -0.003996164430531779
+0.588040593808861090, -0.005577271558238297
+0.068801470742233334, 0.004551314825040714
+1.412064304423644057, 0.007768246623261326
diff --git a/data/numpy/CorrNumpyData_sin.csv b/data/numpy/CorrNumpyData_sin.csv
index c67034d5..58536327 100644
--- a/data/numpy/CorrNumpyData_sin.csv
+++ b/data/numpy/CorrNumpyData_sin.csv
@@ -1,256 +1,256 @@
-0.000000000000000000, 0.992479534598710078
-0.122410675199216196, 0.970148318611752769
-0.242980179903263871, 0.933457538957894850
-0.359895036534988111, 0.883070868697355182
-0.471396736825997642, 0.819852803051039025
-0.575808191417845339, 0.744854052731173999
-0.671558954847018330, 0.659294238404743105
-0.757208846506484567, 0.564542169170611952
-0.831469612302545236, 0.462094022396172144
-0.893224301195515324, 0.353549771639504962
-0.941544065183020806, 0.240588233269440677
-0.975702130038528570, 0.124941120466256717
-0.995184726672196818, 0.008366505309023380
-0.999698818696204250, -0.107377904505368799
-0.989176509964781014, -0.220561268153400991
-0.963776065795439840, -0.329505493787573711
-0.923879532511286738, -0.432610113236106208
-0.870086991108711461, -0.528375780656460847
-0.803207531480644943, -0.615426050332720909
-0.724247082951466892, -0.692527117696546624
-0.634393284163645488, -0.758605241117811024
-0.534997619887097153, -0.812761599508132537
-0.427555093430282029, -0.854284381705073148
-0.313681740398891407, -0.882657947305751311
-0.195090322016128609, -0.897568944407696634
-0.073564563599667732, -0.898909316877034903
--0.049067674327417724, -0.886776181569250421
--0.170961888760300967, -0.861468603641454167
--0.290284677254462109, -0.823481344990056652
--0.405241314004989694, -0.773495706215088452
--0.514102744193221550, -0.712367625672146842
--0.615231590580626708, -0.641113239484276010
--0.707106781186547462, -0.560892143256914943
--0.788346427626605895, -0.472988629134621030
--0.857728610000272007, -0.378791200288979724
--0.914209755703530469, -0.279770688535145196
--0.956940335732208824, -0.177457319219325449
--0.985277642388941111, -0.073417080562400219
--0.998795456205172405, 0.030772237868460353
--0.997290456678690207, 0.133544971025683912
--0.980785280403230431, 0.233371105792805650
--0.949528180593036786, 0.328779056393039726
--0.903989293123443338, 0.418377348802477678
--0.844853565249707228, 0.500874894776658475
--0.773010453362736882, 0.575099560402658749
--0.689540544737067163, 0.640014762682466598
--0.595699304492433246, 0.694733860062898501
--0.492898192229784260, 0.738532138523888992
--0.382683432365090392, 0.770856233245865496
--0.266712757474898587, 0.791330866386675491
--0.146730474455362386, 0.799762823470699269
--0.024541228522912448, 0.796142133671910890
-0.098017140329560021, 0.780640462196614093
-0.219101240156869687, 0.753606765381665822
-0.336889853392219552, 0.715560300375173819
-0.449611329654606540, 0.667181120737229905
-0.555570233019601845, 0.609298226399368703
-0.653172842953776756, 0.542875570605785285
-0.740951125354958773, 0.468996157229249255
-0.817584813151583711, 0.388844488769296726
-0.881921264348354828, 0.303687648022061774
-0.932992798834738957, 0.214855314550808169
-0.970031253194543863, 0.123719030447297124
-0.992479534598709967, 0.031671038295613123
-1.000000000000000000, -0.059896982351527177
-0.992479534598710078, -0.149614955304087666
-0.970031253194544307, -0.236154906780420420
-0.932992798834739179, -0.318250616469699710
-0.881921264348355161, -0.394716129897518642
-0.817584813151583600, -0.464462861664742266
-0.740951125354959772, -0.526515043360358148
-0.653172842953777200, -0.580023297716587782
-0.555570233019602289, -0.624276151418099001
-0.449611329654606262, -0.658709332392865221
-0.336889853392220939, -0.682912732861178817
-0.219101240156870269, -0.696634956336384392
-0.098017140329560631, -0.699785404573607162
--0.024541228522912725, -0.692433898560495975
--0.146730474455360888, -0.674807865447294430
--0.266712757474897977, -0.647287160243041115
--0.382683432365089837, -0.610396626600168690
--0.492898192229782928, -0.564796534538500872
--0.595699304492432691, -0.511271064024541588
--0.689540544737066718, -0.450715031468809868
--0.773010453362737104, -0.384119081028168274
--0.844853565249706451, -0.312553583752383513
--0.903989293123443005, -0.237151504805531654
--0.949528180593036564, -0.159090511998508599
--0.980785280403230542, -0.079574607531040883
--0.997290456678690096, 0.000184430928726673
--0.998795456205172405, 0.078985513921126266
--0.985277642388941222, 0.155656327346548218
--0.956940335732208713, 0.229070770718504957
--0.914209755703531024, 0.298165487155211406
--0.857728610000272340, 0.361955242614025230
--0.788346427626606228, 0.419546932295545294
--0.707106781186548461, 0.470152015767762443
--0.615231590580627596, 0.513097208785319614
--0.514102744193222105, 0.547833288565239274
--0.405241314004989805, 0.573941899956858959
--0.290284677254463552, 0.591140282014161356
--0.170961888760301994, 0.599283867430723705
--0.049067674327418334, 0.598366740610338566
-0.073564563599667565, 0.588519973299094334
-0.195090322016127138, 0.570007889184481753
-0.313681740398890796, 0.543222340177032526
-0.427555093430281863, 0.508675106756749762
-0.534997619887097375, 0.466988562347558922
-0.634393284163644711, 0.418884766772879669
-0.724247082951466559, 0.365173176082189355
-0.803207531480644832, 0.306737175108569959
-0.870086991108711572, 0.244519654760061156
-0.923879532511286405, 0.179507868058946807
-0.963776065795439729, 0.112717807177674045
-0.989176509964781014, 0.045178348093392037
-0.999698818696204139, -0.022084590028083953
-0.995184726672196929, -0.088063626965863784
-0.975702130038528681, -0.151785008448824837
-0.941544065183020806, -0.212322972085737582
-0.893224301195515880, -0.268813180358791093
-0.831469612302545680, -0.320465026025921751
-0.757208846506484790, -0.366572635301264493
-0.671558954847018330, -0.406524416676336320
-0.575808191417846227, -0.439811027825177281
-0.471396736825998253, -0.466031659294213307
-0.359895036534988388, -0.484898561180063081
-0.242980179903263677, -0.496239767299354928
-0.122410675199217264, -0.500000000000000000
-0.000000000000000612, -0.496239767299355039
--0.122410675199216057, -0.485132692014480837
--0.242980179903262483, -0.466961139540525538
--0.359895036534987223, -0.442110236523177713
--0.471396736825995644, -0.411060396475247281
--0.575808191417845228, -0.374378490053694613
--0.671558954847017331, -0.332707816927855005
--0.757208846506485123, -0.286757052660811085
--0.831469612302545014, -0.237288357568869013
--0.893224301195514547, -0.185104844943395186
--0.941544065183020917, -0.131037613191006014
--0.975702130038528348, -0.075932550301476651
--0.995184726672196707, -0.020637119570479753
--0.999698818696204250, 0.034012667277687689
--0.989176509964781125, 0.087204889415951573
--0.963776065795439618, 0.138163777605028570
--0.923879532511286850, 0.186161017121214079
--0.870086991108712238, 0.230526128410244002
--0.803207531480644499, 0.270655777964187216
--0.724247082951467336, 0.306021891015178016
--0.634393284163647042, 0.336178458492957355
--0.534997619887096931, 0.360766952946410813
--0.427555093430282973, 0.379520291408554811
--0.313681740398893683, 0.392265307104136041
--0.195090322016128331, 0.398923716068351641
--0.073564563599668786, 0.399511588774448700
-0.049067674327418889, 0.394137360374779866
-0.170961888760300801, 0.382998435775349866
-0.290284677254460721, 0.366376467138291417
-0.405241314004990305, 0.344631401214952504
-0.514102744193220995, 0.318194411858843784
-0.615231590580625154, 0.287559848891002223
-0.707106781186547573, 0.253276347966601589
-0.788346427626605561, 0.215937257038010255
-0.857728610000270786, 0.176170543286484904
-0.914209755703530580, 0.134628349907914113
-0.956940335732208380, 0.091976374839174951
-0.985277642388941333, 0.048883243398691337
-0.998795456205172405, 0.006010043931373469
-0.997290456678690318, -0.035999810017619677
-0.980785280403230431, -0.076530235593359808
-0.949528180593037008, -0.115001509677898531
-0.903989293123444337, -0.150878538858928934
-0.844853565249707117, -0.183678252694835648
-0.773010453362737882, -0.212976018926925303
-0.689540544737066274, -0.238410996942144099
-0.595699304492433690, -0.259690364508542770
-0.492898192229785537, -0.276592372268245679
-0.382683432365089338, -0.288968200348145410
-0.266712757474899198, -0.296742611404284928
-0.146730474455363857, -0.299913414122597088
-0.024541228522912174, -0.298549770335812426
--0.098017140329559410, -0.292789397177349753
--0.219101240156867355, -0.282834732790155474
--0.336889853392219829, -0.268948149777416268
--0.449611329654605207, -0.251446314585957342
--0.555570233019602733, -0.230693803146126419
--0.653172842953776311, -0.207096093182276147
--0.740951125354957774, -0.181092061520326641
--0.817584813151583822, -0.153146120356297932
--0.881921264348354605, -0.123740129754567718
--0.932992798834738069, -0.093365224599176205
--0.970031253194543974, -0.062513692847689026
--0.992479534598709856, -0.031671038295613130
--1.000000000000000000, -0.001308355248080923
--0.992479534598710078, 0.028124865352455730
--0.970031253194544418, 0.056207388512926358
--0.932992798834738735, 0.082552248056700916
--0.881921264348355383, 0.106812034188596028
--0.817584813151584933, 0.128683384241233045
--0.740951125354958995, 0.147910620107115892
--0.653172842953777644, 0.164288491565315220
--0.555570233019604287, 0.177664000820341395
--0.449611329654606817, 0.187937299801354929
--0.336889853392221550, 0.195061667841914560
--0.219101240156869159, 0.199042593000285983
--0.098017140329561242, 0.199935995225504981
-0.024541228522910335, 0.197845643578105523
-0.146730474455362053, 0.192919832549574483
-0.266712757474897422, 0.185347393987397663
-0.382683432365087617, 0.175353131045812904
-0.492898192229783982, 0.163192768798178317
-0.595699304492432247, 0.149147522548808087
-0.689540544737064942, 0.133518389386987041
-0.773010453362736660, 0.116620271084619559
-0.844853565249706118, 0.098776037037242415
-0.903989293123443560, 0.080310634606085812
-0.949528180593036453, 0.061545350990444343
-0.980785280403229986, 0.042792325731207073
-0.997290456678690207, 0.024349406234982218
-0.998795456205172405, 0.006495430459024216
-0.985277642388941666, -0.010513988719317172
-0.956940335732208935, -0.026450113716010137
-0.914209755703531246, -0.041114115058600700
-0.857728610000271674, -0.054339447323711945
-0.788346427626606672, -0.065993541702271619
-0.707106781186548905, -0.075978801954459399
-0.615231590580626597, -0.084232903785183610
-0.514102744193222549, -0.090728410713473998
-0.405241314004992026, -0.095471732090754602
-0.290284677254462442, -0.098501460819690800
-0.170961888760302605, -0.099886139328137502
-0.049067674327420721, -0.099721512270993462
--0.073564563599666954, -0.098127333097479133
--0.195090322016126527, -0.095243798887963457
--0.313681740398891906, -0.091227693615310773
--0.427555093430281308, -0.086248324131896092
--0.534997619887095377, -0.080483335666190342
--0.634393284163645599, -0.074114494404346087
--0.724247082951466115, -0.067323523835972510
--0.803207531480643389, -0.060288078993677767
--0.870086991108711238, -0.053177938577516085
--0.923879532511286183, -0.046151489321497416
--0.963776065795439063, -0.039352569949992963
--0.989176509964780903, -0.032907733831935668
--0.999698818696204139, -0.026923980136696113
--0.995184726672196818, -0.021486993112570872
--0.975702130038528792, -0.016659918247284952
--0.941544065183021583, -0.012482692741565517
--0.893224301195515324, -0.008971936151009786
--0.831469612302546013, -0.006121395450966438
--0.757208846506486344, -0.003902927376214864
--0.671558954847018774, -0.002267989899455331
--0.575808191417846782, -0.001149604349000094
--0.471396736825997253, -0.000464740123156026
--0.359895036534988944, -0.000117065417208812
--0.242980179903265980, 0.000000000000000000
+0.000000000000000000, 1.000000000000000000
+0.122410675199216196, 0.992479534598710078
+0.242980179903263871, 0.970148318611752769
+0.359895036534988111, 0.933457538957894850
+0.471396736825997642, 0.883070868697355182
+0.575808191417845339, 0.819852803051039025
+0.671558954847018330, 0.744854052731173999
+0.757208846506484567, 0.659294238404743105
+0.831469612302545236, 0.564542169170611952
+0.893224301195515324, 0.462094022396172144
+0.941544065183020806, 0.353549771639504962
+0.975702130038528570, 0.240588233269440677
+0.995184726672196818, 0.124941120466256717
+0.999698818696204250, 0.008366505309023380
+0.989176509964781014, -0.107377904505368799
+0.963776065795439840, -0.220561268153400991
+0.923879532511286738, -0.329505493787573711
+0.870086991108711461, -0.432610113236106208
+0.803207531480644943, -0.528375780656460847
+0.724247082951466892, -0.615426050332720909
+0.634393284163645488, -0.692527117696546624
+0.534997619887097153, -0.758605241117811024
+0.427555093430282029, -0.812761599508132537
+0.313681740398891407, -0.854284381705073148
+0.195090322016128609, -0.882657947305751311
+0.073564563599667732, -0.897568944407696634
+-0.049067674327417724, -0.898909316877034903
+-0.170961888760300967, -0.886776181569250421
+-0.290284677254462109, -0.861468603641454167
+-0.405241314004989694, -0.823481344990056652
+-0.514102744193221550, -0.773495706215088452
+-0.615231590580626708, -0.712367625672146842
+-0.707106781186547462, -0.641113239484276010
+-0.788346427626605895, -0.560892143256914943
+-0.857728610000272007, -0.472988629134621030
+-0.914209755703530469, -0.378791200288979724
+-0.956940335732208824, -0.279770688535145196
+-0.985277642388941111, -0.177457319219325449
+-0.998795456205172405, -0.073417080562400219
+-0.997290456678690207, 0.030772237868460353
+-0.980785280403230431, 0.133544971025683912
+-0.949528180593036786, 0.233371105792805650
+-0.903989293123443338, 0.328779056393039726
+-0.844853565249707228, 0.418377348802477678
+-0.773010453362736882, 0.500874894776658475
+-0.689540544737067163, 0.575099560402658749
+-0.595699304492433246, 0.640014762682466598
+-0.492898192229784260, 0.694733860062898501
+-0.382683432365090392, 0.738532138523888992
+-0.266712757474898587, 0.770856233245865496
+-0.146730474455362386, 0.791330866386675491
+-0.024541228522912448, 0.799762823470699269
+0.098017140329560021, 0.796142133671910890
+0.219101240156869687, 0.780640462196614093
+0.336889853392219552, 0.753606765381665822
+0.449611329654606540, 0.715560300375173819
+0.555570233019601845, 0.667181120737229905
+0.653172842953776756, 0.609298226399368703
+0.740951125354958773, 0.542875570605785285
+0.817584813151583711, 0.468996157229249255
+0.881921264348354828, 0.388844488769296726
+0.932992798834738957, 0.303687648022061774
+0.970031253194543863, 0.214855314550808169
+0.992479534598709967, 0.123719030447297124
+1.000000000000000000, 0.031671038295613123
+0.992479534598710078, -0.059896982351527177
+0.970031253194544307, -0.149614955304087666
+0.932992798834739179, -0.236154906780420420
+0.881921264348355161, -0.318250616469699710
+0.817584813151583600, -0.394716129897518642
+0.740951125354959772, -0.464462861664742266
+0.653172842953777200, -0.526515043360358148
+0.555570233019602289, -0.580023297716587782
+0.449611329654606262, -0.624276151418099001
+0.336889853392220939, -0.658709332392865221
+0.219101240156870269, -0.682912732861178817
+0.098017140329560631, -0.696634956336384392
+-0.024541228522912725, -0.699785404573607162
+-0.146730474455360888, -0.692433898560495975
+-0.266712757474897977, -0.674807865447294430
+-0.382683432365089837, -0.647287160243041115
+-0.492898192229782928, -0.610396626600168690
+-0.595699304492432691, -0.564796534538500872
+-0.689540544737066718, -0.511271064024541588
+-0.773010453362737104, -0.450715031468809868
+-0.844853565249706451, -0.384119081028168274
+-0.903989293123443005, -0.312553583752383513
+-0.949528180593036564, -0.237151504805531654
+-0.980785280403230542, -0.159090511998508599
+-0.997290456678690096, -0.079574607531040883
+-0.998795456205172405, 0.000184430928726673
+-0.985277642388941222, 0.078985513921126266
+-0.956940335732208713, 0.155656327346548218
+-0.914209755703531024, 0.229070770718504957
+-0.857728610000272340, 0.298165487155211406
+-0.788346427626606228, 0.361955242614025230
+-0.707106781186548461, 0.419546932295545294
+-0.615231590580627596, 0.470152015767762443
+-0.514102744193222105, 0.513097208785319614
+-0.405241314004989805, 0.547833288565239274
+-0.290284677254463552, 0.573941899956858959
+-0.170961888760301994, 0.591140282014161356
+-0.049067674327418334, 0.599283867430723705
+0.073564563599667565, 0.598366740610338566
+0.195090322016127138, 0.588519973299094334
+0.313681740398890796, 0.570007889184481753
+0.427555093430281863, 0.543222340177032526
+0.534997619887097375, 0.508675106756749762
+0.634393284163644711, 0.466988562347558922
+0.724247082951466559, 0.418884766772879669
+0.803207531480644832, 0.365173176082189355
+0.870086991108711572, 0.306737175108569959
+0.923879532511286405, 0.244519654760061156
+0.963776065795439729, 0.179507868058946807
+0.989176509964781014, 0.112717807177674045
+0.999698818696204139, 0.045178348093392037
+0.995184726672196929, -0.022084590028083953
+0.975702130038528681, -0.088063626965863784
+0.941544065183020806, -0.151785008448824837
+0.893224301195515880, -0.212322972085737582
+0.831469612302545680, -0.268813180358791093
+0.757208846506484790, -0.320465026025921751
+0.671558954847018330, -0.366572635301264493
+0.575808191417846227, -0.406524416676336320
+0.471396736825998253, -0.439811027825177281
+0.359895036534988388, -0.466031659294213307
+0.242980179903263677, -0.484898561180063081
+0.122410675199217264, -0.496239767299354928
+0.000000000000000612, -0.500000000000000000
+-0.122410675199216057, -0.496239767299355039
+-0.242980179903262483, -0.485132692014480837
+-0.359895036534987223, -0.466961139540525538
+-0.471396736825995644, -0.442110236523177713
+-0.575808191417845228, -0.411060396475247281
+-0.671558954847017331, -0.374378490053694613
+-0.757208846506485123, -0.332707816927855005
+-0.831469612302545014, -0.286757052660811085
+-0.893224301195514547, -0.237288357568869013
+-0.941544065183020917, -0.185104844943395186
+-0.975702130038528348, -0.131037613191006014
+-0.995184726672196707, -0.075932550301476651
+-0.999698818696204250, -0.020637119570479753
+-0.989176509964781125, 0.034012667277687689
+-0.963776065795439618, 0.087204889415951573
+-0.923879532511286850, 0.138163777605028570
+-0.870086991108712238, 0.186161017121214079
+-0.803207531480644499, 0.230526128410244002
+-0.724247082951467336, 0.270655777964187216
+-0.634393284163647042, 0.306021891015178016
+-0.534997619887096931, 0.336178458492957355
+-0.427555093430282973, 0.360766952946410813
+-0.313681740398893683, 0.379520291408554811
+-0.195090322016128331, 0.392265307104136041
+-0.073564563599668786, 0.398923716068351641
+0.049067674327418889, 0.399511588774448700
+0.170961888760300801, 0.394137360374779866
+0.290284677254460721, 0.382998435775349866
+0.405241314004990305, 0.366376467138291417
+0.514102744193220995, 0.344631401214952504
+0.615231590580625154, 0.318194411858843784
+0.707106781186547573, 0.287559848891002223
+0.788346427626605561, 0.253276347966601589
+0.857728610000270786, 0.215937257038010255
+0.914209755703530580, 0.176170543286484904
+0.956940335732208380, 0.134628349907914113
+0.985277642388941333, 0.091976374839174951
+0.998795456205172405, 0.048883243398691337
+0.997290456678690318, 0.006010043931373469
+0.980785280403230431, -0.035999810017619677
+0.949528180593037008, -0.076530235593359808
+0.903989293123444337, -0.115001509677898531
+0.844853565249707117, -0.150878538858928934
+0.773010453362737882, -0.183678252694835648
+0.689540544737066274, -0.212976018926925303
+0.595699304492433690, -0.238410996942144099
+0.492898192229785537, -0.259690364508542770
+0.382683432365089338, -0.276592372268245679
+0.266712757474899198, -0.288968200348145410
+0.146730474455363857, -0.296742611404284928
+0.024541228522912174, -0.299913414122597088
+-0.098017140329559410, -0.298549770335812426
+-0.219101240156867355, -0.292789397177349753
+-0.336889853392219829, -0.282834732790155474
+-0.449611329654605207, -0.268948149777416268
+-0.555570233019602733, -0.251446314585957342
+-0.653172842953776311, -0.230693803146126419
+-0.740951125354957774, -0.207096093182276147
+-0.817584813151583822, -0.181092061520326641
+-0.881921264348354605, -0.153146120356297932
+-0.932992798834738069, -0.123740129754567718
+-0.970031253194543974, -0.093365224599176205
+-0.992479534598709856, -0.062513692847689026
+-1.000000000000000000, -0.031671038295613130
+-0.992479534598710078, -0.001308355248080923
+-0.970031253194544418, 0.028124865352455730
+-0.932992798834738735, 0.056207388512926358
+-0.881921264348355383, 0.082552248056700916
+-0.817584813151584933, 0.106812034188596028
+-0.740951125354958995, 0.128683384241233045
+-0.653172842953777644, 0.147910620107115892
+-0.555570233019604287, 0.164288491565315220
+-0.449611329654606817, 0.177664000820341395
+-0.336889853392221550, 0.187937299801354929
+-0.219101240156869159, 0.195061667841914560
+-0.098017140329561242, 0.199042593000285983
+0.024541228522910335, 0.199935995225504981
+0.146730474455362053, 0.197845643578105523
+0.266712757474897422, 0.192919832549574483
+0.382683432365087617, 0.185347393987397663
+0.492898192229783982, 0.175353131045812904
+0.595699304492432247, 0.163192768798178317
+0.689540544737064942, 0.149147522548808087
+0.773010453362736660, 0.133518389386987041
+0.844853565249706118, 0.116620271084619559
+0.903989293123443560, 0.098776037037242415
+0.949528180593036453, 0.080310634606085812
+0.980785280403229986, 0.061545350990444343
+0.997290456678690207, 0.042792325731207073
+0.998795456205172405, 0.024349406234982218
+0.985277642388941666, 0.006495430459024216
+0.956940335732208935, -0.010513988719317172
+0.914209755703531246, -0.026450113716010137
+0.857728610000271674, -0.041114115058600700
+0.788346427626606672, -0.054339447323711945
+0.707106781186548905, -0.065993541702271619
+0.615231590580626597, -0.075978801954459399
+0.514102744193222549, -0.084232903785183610
+0.405241314004992026, -0.090728410713473998
+0.290284677254462442, -0.095471732090754602
+0.170961888760302605, -0.098501460819690800
+0.049067674327420721, -0.099886139328137502
+-0.073564563599666954, -0.099721512270993462
+-0.195090322016126527, -0.098127333097479133
+-0.313681740398891906, -0.095243798887963457
+-0.427555093430281308, -0.091227693615310773
+-0.534997619887095377, -0.086248324131896092
+-0.634393284163645599, -0.080483335666190342
+-0.724247082951466115, -0.074114494404346087
+-0.803207531480643389, -0.067323523835972510
+-0.870086991108711238, -0.060288078993677767
+-0.923879532511286183, -0.053177938577516085
+-0.963776065795439063, -0.046151489321497416
+-0.989176509964780903, -0.039352569949992963
+-0.999698818696204139, -0.032907733831935668
+-0.995184726672196818, -0.026923980136696113
+-0.975702130038528792, -0.021486993112570872
+-0.941544065183021583, -0.016659918247284952
+-0.893224301195515324, -0.012482692741565517
+-0.831469612302546013, -0.008971936151009786
+-0.757208846506486344, -0.006121395450966438
+-0.671558954847018774, -0.003902927376214864
+-0.575808191417846782, -0.002267989899455331
+-0.471396736825997253, -0.001149604349000094
+-0.359895036534988944, -0.000464740123156026
+-0.242980179903265980, -0.000117065417208812
-0.122410675199216112, 0.000000000000000000
diff --git a/data/numpy/CorrNumpyData_sqr.csv b/data/numpy/CorrNumpyData_sqr.csv
index 47a00788..9f1ce1cc 100644
--- a/data/numpy/CorrNumpyData_sqr.csv
+++ b/data/numpy/CorrNumpyData_sqr.csv
@@ -1,3 +1,4 @@
+1.000000000000000000, 1.000000000000000000
1.000000000000000000, 0.925781250000000000
1.000000000000000000, 0.851562500000000000
1.000000000000000000, 0.777343750000000000
@@ -23,7 +24,7 @@
1.000000000000000000, -0.707031250000000000
1.000000000000000000, -0.781250000000000000
1.000000000000000000, -0.855468750000000000
-1.000000000000000000, -0.875000000000000000
+-1.000000000000000000, -0.875000000000000000
-1.000000000000000000, -0.808593750000000000
-1.000000000000000000, -0.742187500000000000
-1.000000000000000000, -0.675781250000000000
@@ -49,7 +50,7 @@
-1.000000000000000000, 0.652343750000000000
-1.000000000000000000, 0.718750000000000000
-1.000000000000000000, 0.785156250000000000
--1.000000000000000000, 0.750000000000000000
+1.000000000000000000, 0.750000000000000000
1.000000000000000000, 0.691406250000000000
1.000000000000000000, 0.632812500000000000
1.000000000000000000, 0.574218750000000000
@@ -74,7 +75,7 @@
1.000000000000000000, -0.539062500000000000
1.000000000000000000, -0.597656250000000000
1.000000000000000000, -0.656250000000000000
-1.000000000000000000, -0.691406250000000000
+-1.000000000000000000, -0.691406250000000000
-1.000000000000000000, -0.640625000000000000
-1.000000000000000000, -0.589843750000000000
-1.000000000000000000, -0.539062500000000000
@@ -100,7 +101,7 @@
-1.000000000000000000, 0.476562500000000000
-1.000000000000000000, 0.527343750000000000
-1.000000000000000000, 0.578125000000000000
--1.000000000000000000, 0.574218750000000000
+1.000000000000000000, 0.574218750000000000
1.000000000000000000, 0.531250000000000000
1.000000000000000000, 0.488281250000000000
1.000000000000000000, 0.445312500000000000
@@ -125,7 +126,7 @@
1.000000000000000000, -0.371093750000000000
1.000000000000000000, -0.414062500000000000
1.000000000000000000, -0.457031250000000000
-1.000000000000000000, -0.500000000000000000
+-1.000000000000000000, -0.500000000000000000
-1.000000000000000000, -0.464843750000000000
-1.000000000000000000, -0.429687500000000000
-1.000000000000000000, -0.394531250000000000
@@ -151,7 +152,7 @@
-1.000000000000000000, 0.308593750000000000
-1.000000000000000000, 0.343750000000000000
-1.000000000000000000, 0.378906250000000000
--1.000000000000000000, 0.390625000000000000
+1.000000000000000000, 0.390625000000000000
1.000000000000000000, 0.363281250000000000
1.000000000000000000, 0.335937500000000000
1.000000000000000000, 0.308593750000000000
@@ -177,7 +178,7 @@
1.000000000000000000, -0.238281250000000000
1.000000000000000000, -0.265625000000000000
1.000000000000000000, -0.292968750000000000
-1.000000000000000000, -0.281250000000000000
+-1.000000000000000000, -0.281250000000000000
-1.000000000000000000, -0.261718750000000000
-1.000000000000000000, -0.242187500000000000
-1.000000000000000000, -0.222656250000000000
@@ -202,7 +203,7 @@
-1.000000000000000000, 0.148437500000000000
-1.000000000000000000, 0.167968750000000000
-1.000000000000000000, 0.187500000000000000
--1.000000000000000000, 0.199218750000000000
+1.000000000000000000, 0.199218750000000000
1.000000000000000000, 0.187500000000000000
1.000000000000000000, 0.175781250000000000
1.000000000000000000, 0.164062500000000000
@@ -228,7 +229,7 @@
1.000000000000000000, -0.070312500000000000
1.000000000000000000, -0.082031250000000000
1.000000000000000000, -0.093750000000000000
-1.000000000000000000, -0.097656250000000000
+-1.000000000000000000, -0.097656250000000000
-1.000000000000000000, -0.093750000000000000
-1.000000000000000000, -0.089843750000000000
-1.000000000000000000, -0.085937500000000000
@@ -253,4 +254,3 @@
-1.000000000000000000, -0.011718750000000000
-1.000000000000000000, -0.007812500000000000
-1.000000000000000000, -0.003906250000000000
--1.000000000000000000, 0.000000000000000000
diff --git a/src/Numerics.Tests/StatisticsTests/CorrelationTests.cs b/src/Numerics.Tests/StatisticsTests/CorrelationTests.cs
index 18369ba1..ca1e34e2 100644
--- a/src/Numerics.Tests/StatisticsTests/CorrelationTests.cs
+++ b/src/Numerics.Tests/StatisticsTests/CorrelationTests.cs
@@ -78,12 +78,48 @@ namespace MathNet.Numerics.UnitTests.StatisticsTests
var resNumpy = data.Select(tuple => Double.Parse(tuple.Item2, CultureInfo.InvariantCulture)).ToArray();
var resMathNet = Correlation.Auto(series);
+
+ Assert.AreEqual(resNumpy.Length, resMathNet.Length);
for (int i = 0; i < resMathNet.Length; i++)
{
Assert.AreEqual(resNumpy[i], resMathNet[i], tol);
}
}
+ [TestCase()]
+ public void AutoCorrelationTest2()
+ {
+ var tol = 1e-14;
+ var n = 10;
+ // make some dummy data
+ var a = Generate.LinearSpacedMap(n, 0, 2*Constants.Pi, Math.Sin);
+
+ var idxs = new int[] { 2, 1, 7 };
+
+ var resFull = Correlation.Auto(a);
+ var resLim = Correlation.Auto(a, 4);
+
+ Assert.AreEqual(4+1, resLim.Length);
+ for (int i = 0; i < resLim.Length; i++)
+ {
+ Assert.AreEqual(resFull[i], resLim[i], tol);
+ }
+
+ var resRange = Correlation.Auto(a, 3, 6); // -> Order will be set in function anyways
+ Assert.AreEqual(6-3+1, resRange.Length);
+ for (int i = 0; i < resRange.Length; i++)
+ {
+ Assert.AreEqual(resFull[i], resLim[i], tol);
+ }
+
+ var resIdxs = Correlation.Auto(a, idxs);
+ Assert.AreEqual(idxs.Length, resIdxs.Length);
+ Assert.AreEqual(resFull[2], resIdxs[0], tol);
+ Assert.AreEqual(resFull[1], resIdxs[1], tol);
+ Assert.AreEqual(resFull[7], resIdxs[2], tol);
+
+ }
+
///
/// Pearson correlation test.
///
diff --git a/src/Numerics/Statistics/Correlation.cs b/src/Numerics/Statistics/Correlation.cs
index a2b870b7..2de8517e 100644
--- a/src/Numerics/Statistics/Correlation.cs
+++ b/src/Numerics/Statistics/Correlation.cs
@@ -44,7 +44,6 @@ namespace MathNet.Numerics.Statistics
{
///
/// Autocorrelation function (ACF) based on FFT for all possible lags k.
- /// The first element is hidden since ACF(k = 0) = 1.
///
/// Data array to calculate auto correlation for.
/// An array with the ACF as a function of the lags k.
@@ -55,11 +54,10 @@ namespace MathNet.Numerics.Statistics
///
/// Autocorrelation function (ACF) based on FFT for lags between kMin and kMax.
- /// The first element is hidden since ACF(k = 0) = 1.
///
/// The data array to calculate auto correlation for.
- /// Max lag to calculate ACF for must be positive and smaller than x.Length-1.
- /// Min lag to calculate ACF for (0 = no shift with acf=1) must be zero or positive and smaller than x.Length-1.
+ /// Max lag to calculate ACF for must be positive and smaller than x.Length.
+ /// Min lag to calculate ACF for (0 = no shift with acf=1) must be zero or positive and smaller than x.Length.
/// An array with the ACF as a function of the lags k.
public static double[] Auto(IEnumerable x, int kMax, int kMin = 0)
{
@@ -72,7 +70,6 @@ namespace MathNet.Numerics.Statistics
///
/// Autocorrelation function based on FFT for lags k.
- /// The first element is hidden since ACF(k = 0) = 1.
///
/// The data array to calculate auto correlation for.
/// Array with lags to calculate ACF for.
@@ -89,14 +86,16 @@ namespace MathNet.Numerics.Statistics
throw new ArgumentException("k");
}
+ var k_min = k.Min();
+ var k_max = k.Max();
// get acf between full range
- var acf = AutoCorrelationFft(x, k.Min(), k.Max());
+ var acf = AutoCorrelationFft(x, k_min, k_max);
// map output by indexing
var result = new double[k.Length];
for (int i = 0; i < result.Length; i++)
{
- result[i] = acf[k[i]];
+ result[i] = acf[k[i] - k_min];
}
return result;
@@ -106,8 +105,8 @@ namespace MathNet.Numerics.Statistics
/// The internal core method for calculating the autocorrelation.
///
/// The data array to calculate auto correlation for
- /// Min lag to calculate ACF for (0 = no shift with acf=1) must be zero or positive and smaller than x.Length-1
- /// Max lag to calculate ACF for must be positive and smaller than x.Length-1
+ /// Min lag to calculate ACF for (0 = no shift with acf=1) must be zero or positive and smaller than x.Length
+ /// Max lag (EXCLUSIVE) to calculate ACF for must be positive and smaller than x.Length
/// An array with the ACF as a function of the lags k.
private static double[] AutoCorrelationFft(IEnumerable x, int k_low, int k_high)
{
@@ -162,13 +161,12 @@ namespace MathNet.Numerics.Statistics
double acf_Val1 = x_fft2[0].Real;
- double[] acf_Vec = new double[k_high - k_low];
- double[] acf_Val = new double[k_high + 1];
+ double[] acf_Vec = new double[k_high - k_low + 1];
- // normalize such that acf[0] would be 1.0 and drop the first element
- for (int ii = 0; ii < (k_high - k_low); ii++)
+ // normalize such that acf[0] would be 1.0
+ for (int ii = 0; ii < (k_high - k_low + 1); ii++)
{
- acf_Vec[ii] = x_fft2[k_low + ii + 1].Real / acf_Val1;
+ acf_Vec[ii] = x_fft2[k_low + ii].Real / acf_Val1;
}
return acf_Vec;