https://github.com/tohtsky/bayesian-binomial-test
Simple Bayesian A/B testing utility made with Rust + WebAssembly and Vue.js
https://github.com/tohtsky/bayesian-binomial-test
bayesian-statistics wasm-bindgen
Last synced: 3 months ago
JSON representation
Simple Bayesian A/B testing utility made with Rust + WebAssembly and Vue.js
- Host: GitHub
- URL: https://github.com/tohtsky/bayesian-binomial-test
- Owner: tohtsky
- Created: 2022-06-04T12:48:28.000Z (about 3 years ago)
- Default Branch: main
- Last Pushed: 2022-06-08T15:03:47.000Z (about 3 years ago)
- Last Synced: 2025-01-28T10:45:36.164Z (5 months ago)
- Topics: bayesian-statistics, wasm-bindgen
- Language: Rust
- Homepage: https://tohtsky.github.io/bayesian-binomial-test/
- Size: 800 KB
- Stars: 2
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: ReadMe.md
Awesome Lists containing this project
README
# Bayesian binomial test using WebAssembly
[**Demo**](https://tohtsky.github.io/bayesian-binomial-test/)
A/B test significance judgement using bayesian beta-binomial distribution is simple. In Python, we can do that like:
```python
import numpy as npalpha_prior = 1.0
beta_prior = 1.0n_events_a = 100
n_success_a = 30n_events_b = 10
n_success_b = 5n_samples = 10000
rng = np.random.default_rng(0)
posterior_a = rng.beta(alpha_prior + n_success_a, beta_prior + n_events_a - n_success_a, size=n_samples)
posterior_b = rng.beta(alpha_prior + n_success_b, beta_prior + n_events_b - n_success_b, size=n_samples)# 0.90576
(posterior_a < posterior_b).mean()
```This simple demo visualizes the Bayesian binomial test, using Rust + WebAssembly to sample from the posterior distribution (obviously overkill, but fun).
This should work off-line. Get a single HTML file from [the latest release](https://github.com/tohtsky/bayesian-binomial-test/releases/latest).
A similar application that influcend this project can be found [here](https://making.lyst.com/bayesian-calculator/).