Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Chatterjee Correlation Coefficient #770

Merged
merged 23 commits into from
May 25, 2022
Merged
Changes from 1 commit
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
7d8452e
Implement rank vector
mborland Feb 25, 2022
cbee638
Add documentation. Admittedly terrible.
NAThompson Mar 2, 2022
3761782
Add unit tests.
NAThompson Mar 2, 2022
cc5a24a
Cleanup method of detecting if execution policies are valid or not
mborland Mar 2, 2022
91326b1
Implement and test chatterjee correlation
mborland Mar 2, 2022
185e9c8
Add spot checks and special handling for constant Y
mborland Mar 3, 2022
b2539a5
Add performance file
mborland Mar 3, 2022
779589c
Add execution policy support to rank
mborland Mar 3, 2022
79e2b59
Remove duplicates from v when generating the order vector
mborland Mar 4, 2022
5a80e5d
Fix macro error for use of <execution>
mborland Mar 4, 2022
d0e51cc
Use explicit types instead of auto to avoid warnings
mborland Mar 4, 2022
30fd8a0
Add execution policy testing to rank
mborland Mar 4, 2022
9aa8e53
Add threaded implementation
mborland Apr 19, 2022
0ea9a48
Added threaded testing
mborland Apr 20, 2022
260541b
Fix formatting and ASCII issues in test
mborland Apr 20, 2022
3d63c38
Fix more ASCII issues
mborland May 11, 2022
d43bbba
refactoring
mborland May 22, 2022
ff15648
Fix threaded impl
mborland May 22, 2022
7219017
Remove non-ASCII apostrophe
mborland May 22, 2022
65d4ec5
Doc fixes and add test comparing generally to paper values
mborland May 23, 2022
e992d6c
Merge remote-tracking branch 'boostorg/develop' into chaterjee
mborland May 24, 2022
e55fb3a
Significantly tighten tolerance around expected values from paper
mborland May 24, 2022
ea41f94
Change tolerance for sin comparison
mborland May 24, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Add performance file
[ci skip]
  • Loading branch information
mborland committed Apr 19, 2022

Unverified

This user has not yet uploaded their public signing key.
commit b2539a5b964ff67557ba7bd3f9a539f5fe4540f0
34 changes: 34 additions & 0 deletions reporting/performance/chatterjee_correlation_performance.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
// (C) Copyright Matt Borland 2022.
// Use, modification and distribution are subject to the
// Boost Software License, Version 1.0. (See accompanying file
// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)

#include <vector>
#include <algorithm>
#include <boost/math/tools/random_vector.hpp>
#include <boost/math/statistics/chatterjee_correlation.hpp>
#include <benchmark/benchmark.h>

using boost::math::generate_random_vector;

template <typename T>
void chatterjee_correlation(benchmark::State& state)
{
constexpr std::size_t seed {};
const std::size_t size = state.range(0);
std::vector<T> u = generate_random_vector<T>(size, seed);
std::vector<T> v = generate_random_vector<T>(size, seed);

std::sort(u.begin(), u.end());

for (auto _ : state)
{
benchmark::DoNotOptimize(boost::math::statistics::chatterjee_correlation(u, v));
}
state.SetComplexityN(state.range(0));
}

BENCHMARK_TEMPLATE(chatterjee_correlation, float)->RangeMultiplier(2)->Range(1 << 6, 1 << 20)->Complexity()->UseRealTime();
BENCHMARK_TEMPLATE(chatterjee_correlation, double)->RangeMultiplier(2)->Range(1 << 6, 1 << 20)->Complexity()->UseRealTime();

BENCHMARK_MAIN();