### ----------------------------------------------------
### -- Statistics
### -- Licenses: Artistic-2.0
### -- Authors: Suman Khanal <suman81765@gmail.com>
### -- File: t/02-pearson-spearman-bi.rakutest
### ----------------------------------------------------
use Test;
use Statistics;
# use Correlation::PearsonSpearman;
# use Correlation::Kendall;


my @test1 = [6,6,4,6,8,6,8,4,4,6,6,8,8,8,8,8,8,4,4,4,4,8,8,8,8,4,4,4,8,6,8,4];
my @test2 = [160.0,160.0,108.0,258.0,360.0,225.0,360.0,146.7,140.8,167.6,167.6,
            275.8,275.8,275.8,472.0,460.0,440.0,78.7,75.7,71.1,120.1,318.0,304.0,
            350.0,400.0,79.0,120.3,95.1,351.0,145.0,301.0,121.0];

my @data1=[12,2,1,12,2];
my @data2=[1,4,7,1,0];

diag("Testing pearson_cor_coef...");
is pearson_cor_coef(@test1, @test2), 0.9020328721469989;

diag("Testing spearman_cor_coef...");
is spearman_cor_coef(@test1, @test2), 0.9276515785415314;

diag("Testing bi_cor_coef...");
is bi_cor_coef(@test1, @test2), 0.9146470012038392;
is bi_cor_coef(@data1, @data2), -0.5856205826464312;


done-testing;


