← Back

ofxBayes

github.com/JotaroS/ofxBayes · @JotaroS
OF 0.9 Algorithms Machine Learning

Bayesian framework for openFrameworks

2 0 Last commit 9y ago Created 9y ago

README

ofxBayes

Build Status thumbnail

Introduction

ofxBayes is openFrameworks addon for Bayesian statistics. Now this is a baby project. Currently, you can

for detail take a look at codes below.

Dependency

currently none.

Example



example-basic

Simple Monty-hall problem. Three steps required.

1. Make prior probability 2. Write likelihood function 3. Update your guess!

``[cpp]

//Hypothesis and data _map[0] = 0.f; _map[1] = 0.f; _map[2] = 0.f;

//initialization ofxBayesHist hist(_map); hist.initialize(); hist.disp("Prior probability");

//Likelihood function int choise = 0; hist.likelihoodFunc = [=](int data, int hypo) {

if (hypo == data) return 0.f; else { if (hypo == choise) return 0.5f; else return 1.f; } };

//update posterior prob. hist.update(1); hist.disp("Posterior probability");
``

License

MIT

Acknowledgement

Lot of inspiration from http://greenteapress.com/wp/think-bayes/

Get this addon

HTTPS
SSH