GithubHelp home page GithubHelp logo

maximumgain / basic-probability Goto Github PK

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

The Matlab source code for basic probability used in information theory.

License: MIT License

MATLAB 100.00%
probability bayes-rule marginalization expection variance binary-random-vector chebyshev-inequality large-numbers

basic-probability's Introduction

basic-probability

Matlab source code for basic probability used in information theory.

Static methods are defined in a class named 'probabilityTool'. Simply call a function in this class by probabilityTool.FunctionName.

All methods provides default input for computation.
Your inputs are collected using varargin.


Example: Jointly distributed random variables X and Y are defined with a joint probability distribution pXY(x,y) = Pr(X = x, Y = y), then the marginal distribution pX(x) and pY(y) can be computed by:

[px,py] = probabilityTool.marginalize(pxy) %pxy is the joint probability distribution pXY(x,y)

or

[px,py] = probabilityTool.marginalize(pxy,'r') which returns rational number.

The program also provides default values, invoking [px,py] = probabilityTool.marginalize


Type methods(probabilityTool) to see all methods in this class.

The software provides the following functions.

  • Theorem of total probability @probabilityTool.PRy
  • Marginalization @probabilityTool.marginalize
  • Compute joint distribution @probabilityTool.computeJointDistribution
  • Compute "all-related" probability @probabilityTool.computeAllP
  • Bayes rule @probabilityTool.bayes
  • Compute expected value @probabilityTool.computeExpection
  • Expected value of a function @probabilityTool.expectionOfaFunction
  • Compute variance @probabilityTool.computeVariance
  • An example of binary random vector @probabilityTool.binaryRandomVectorExample (uses @binomialPR)
  • Use Chebyshev inequality on random vectors @largeNumberExperiment (uses @randomSamples)

Notations in source code:

  • px: Pr(X = x)
  • py: Pr(Y = y)
  • pxy: Pr(X=x,Y=y) joint probability
  • pxgy: Pr(X=x | Y=y) conditional probability
  • pygx: Pr(Y=y | X=x) conditional probability
  • EX: E[X] expection of pX(x)
  • EgX: E[g(x)] expection of a function g(x), where g(x) is a function of pX(x)
  • Var: Var[X] variance of pX(x)

v1.0 June 28, 2020 Initial release

basic-probability's People

Contributors

maximumgain 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.