Skip to content

ankane/bayestest-cpp

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

76 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

BayesTest C++

Bayesian A/B testing calculations for C++

Based on this post by Evan Miller

Also available in C and Rust

Build Status

Installation

Add the header to your project (supports C++11 and greater).

There is also support for CMake and FetchContent:

include(FetchContent)

FetchContent_Declare(bayestest GIT_REPOSITORY https://github.com/ankane/bayestest-cpp.git GIT_TAG v0.2.0)
FetchContent_MakeAvailable(bayestest)

target_link_libraries(app PRIVATE bayestest::bayestest)

Getting Started

Include the header

#include "bayestest.hpp"

Binary Outcomes

bayestest::BinaryTest test;
test.add(participants_a, conversions_a);
test.add(participants_b, conversions_b);
std::vector<double> probabilities = test.probabilities();

Supports up to 4 variants

Count Data

bayestest::CountTest test;
test.add(events_a, exposure_a);
test.add(events_b, exposure_b);
std::vector<double> probabilities = test.probabilities();

Supports up to 3 variants

History

View the changelog

Contributing

Everyone is encouraged to help improve this project. Here are a few ways you can help:

To get started with development:

git clone https://github.com/ankane/bayestest-cpp.git
cd bayestest-cpp
cmake -S . -B build
cmake --build build
build/test

About

Bayesian A/B testing calculations for C++

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors