Giter Site home page Giter Site logo

tristanfauvel / bayesian_test_for_preference Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 0.0 87 KB

An analysis of preference comparisons based on the Bayes factor

License: MIT License

MATLAB 5.01% Python 2.24% Jupyter Notebook 92.75%
bayesian-statistics preference-learning

bayesian_test_for_preference's Introduction

Bayesian test for preference

Consider a situation where the goal is to identify which of two configurations is preferred. For example, we would like to know if people in a population prefer blue vs red items. Each participant $i$ among a total of $N$ performs $n_i$ pairwise comparisons between objects of the two colors. We would like to use a statistical test to determine which of the two configurations is preferred. The two competing hypotheses are $H_1$ (resp. $H_2$): items in the configuration $A_1$ (resp. $A_2$) are preferred to items in configuration $A_2$ (resp. $A_1$). This repository contains the code to run a Bayesian analysis method for this problem based on the Bayes factor. It is adapted from Kass & Raftery, 1995 (see also chapter 5 of Robert, 2005) and was first published in Fauvel & Chalk, 2022.

Maths

The derivation of the Bayes factor for preference comparisons is presented in the notebook TestBayesFactorPref.ipynb

Code usage

I provide both a Python and a Matlab implementation of the BayesFactorPref function in this repository. In order to test it, you can use TestBayesFactorPref either in Matlab or Python.

References

  • R. E. Kass and A. E. Raftery. Bayes Factors. J. Am. Stat. Assoc., 90(430):773, 1995
  • C. P. Robert. Le choix bayésien. Statistique et probabilités appliquées. Springer-Verlag, Paris, 2006.
  • T. Fauvel and M. Chalk, (2022). Human-in-the-loop optimization of visual prosthetic stimulation. Journal of Neural Engineering,19(3), 036038.

If you use this software, please reference it as follows : T. Fauvel and M. Chalk, (2022). Human-in-the-loop optimization of visual prosthetic stimulation. Journal of Neural Engineering,19(3), 036038.

License

This software is distributed under the MIT License. Please refer to the file LICENCE.txt included for details.

bayesian_test_for_preference's People

Contributors

tristanfauvel avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.