Pearson Correlation: Seq.pearsonOfPairs and Seq.pearsonBy.
Pearson Weighted Correlation: Seq.pearsonWeightedOfTriples and Seq.pearsonWeightedBy.
Spearman Correlation: Seq.spearmanOfPairs and Seq.spearmanBy.
Bicor Correlation: Seq.bicorOfPairs and Seq.bicorBy.
Kendall Correlation: Seq.kendallOfPairs and Seq.kendallBy.
Notes:
...OfPairsreceives a sequence of paired tuples and returns the correspondent correlation coefficient.
pearsonWeightedOfTriples receives a sequence of tuples with 3 elements (seq1 seq2 weights). The triples naming follows FSharp.Core.Seq.zip says it makes pairs, Seq.zip3 says it makes triples
...By follows the same rationale as stDevBy, averageBy, and so on.
The tests included are based on the actual correlation tests. (Some of them as bicor, and person weighted had no tests, so new tests were not added for the related functions).
Seq.fs, List.fs and Array.fs: files:
Addresses the issue https://github.com/fslaborg/FSharp.Stats/issues/147 about changing covBy and covPopulationBy to receive one collection rather than two, and to follow the same rationale as in stDevBy and averageBy.
Addresses issues https://github.com/fslaborg/FSharp.Stats/issues/123 and https://github.com/fslaborg/FSharp.Stats/issues/147.
This PR contains changes in Correlation.fs, Seq.fs, List.fs and Array.fs files (Tests included).
Correlation.fs files:
Addresses the comment https://github.com/fslaborg/FSharp.Stats/issues/123#issuecomment-817145084 about including:
Seq.pearsonOfPairs
andSeq.pearsonBy
.Seq.pearsonWeightedOfTriples
andSeq.pearsonWeightedBy
.Seq.spearmanOfPairs
andSeq.spearmanBy
.Seq.bicorOfPairs
andSeq.bicorBy
.Seq.kendallOfPairs
andSeq.kendallBy
.Notes:
...OfPairs
receives a sequence of paired tuples and returns the correspondent correlation coefficient.pearsonWeightedOfTriples
receives a sequence of tuples with 3 elements (seq1 seq2 weights). The triples naming followsFSharp.Core.
Seq.zip
says it makes pairs,Seq.zip3
says it makes triples...By
follows the same rationale asstDevBy
,averageBy
, and so on.Seq.fs, List.fs and Array.fs: files:
Addresses the issue https://github.com/fslaborg/FSharp.Stats/issues/147 about changing
covBy
andcovPopulationBy
to receive one collection rather than two, and to follow the same rationale as instDevBy
andaverageBy
.Functions Changed:
Seq.covBy
,List.covBy
,Array.covBy
.Seq.covPopulationBy
,List.covPopulationBy
,Array.covPopulationBy
.Functions Added:
Seq.covOfPairs
,List.covOfPairs
,Array.covOfPairs
.Seq.covPopulationOfPairs
,List.covPopulationOfPairs
,Array.covPopulationOfPairs
.Tests for all these functions were included and based on the
cov
andcovPopulation
tests.