Questions tagged [bayesian]

Bayesian (after Thomas Bayes) refers to methods in probability and statistics that involve quantifying uncertainty about parameter or latent variable estimates by incorporating both prior and observed information. Bayesian modeling, inference, optimization, and model comparison techniques are on topic. A programming element is expected; theoretical/methodological questions should go to https://stats.stackexchange.com.

Overview

Bayesian inference is a method of statistical inference which uses Bayes' theorem - named after Thomas Bayes (1702-1761) - to quantify the uncertainty of parameters or latent variables. The statement of Bayes' theorem in Bayesian inference is

enter image description here

Here θ represents the parameters to be inferred and d the data. P(θ|d) is the posterior probability and P(d|θ) is the likelihood function. P(θ) is the prior: a function encoding previous beliefs about θ within a model appropriate for the data. P(d) is a normalization factor.

The formula is used as an updating procedure: as more data become available, the posterior can be updated successively. In the first instance, the prior must be specified by the user. In later updates, the prior is usually chosen to be the posterior from a previous updating procedure.

References

The following threads contain lists of references:

The following journals are dedicated to research in Bayesian statistics:

Tag usage

Questions on tag should be about implementation and programming problems, not about the statistical or theoretical properties of the technique. Consider whether your question might be better suited to Cross Validated, the StackExchange site for statistics, machine learning and data analysis.

1808 questions
16
votes
1 answer

How to extract unsupervised clusters from a Dirichlet Process in PyMC3?

I just finished the Bayesian Analysis in Python book by Osvaldo Martin (great book to understand bayesian concepts and some fancy numpy indexing). I really want to extend my understanding to bayesian mixture models for unsupervised clustering of…
O.rka
  • 29,847
  • 68
  • 194
  • 309
15
votes
3 answers

Detecting 'unusual behavior' using machine learning with CouchDB and Python?

I am collecting a lot of really interesting data points as users come to my Python web service. For example, I have their current city, state, country, user-agent, etc. What I'd like to be able to do is run these through some type of machine…
sullivanmatt
  • 740
  • 7
  • 15
15
votes
2 answers

Implementing Bayesian classifier in Ruby?

I would like to implement a simple Bayesian classification system to do rudimentary sentiment analysis on short messages. Practical suggestions for implementing in Ruby would be welcome. Suggestions for other approaches besides Bayes would also be…
miller
  • 270
  • 3
  • 7
12
votes
4 answers

How to update a matrix of probabilities

I am trying to find/figure out a function that can update probabilities. Suppose there are three players and each of them get a fruit out of a basket: ["apple", "orange", "banana"] I store the probabilities of each player having each fruit in a…
Hadus
  • 1,551
  • 11
  • 22
11
votes
3 answers

Which Python Bayesian text classification modules are similar to dbacl?

A quick Google search reveals that there are a good number of Bayesian classifiers implemented as Python modules. If I want wrapped, high-level functionality similar to dbacl, which of those modules is right for me? Training % dbacl -l one…
Dan
  • 1,721
  • 3
  • 16
  • 20
11
votes
2 answers

Scipy or bayesian optimize function with constraints, bounds and dataframe in python

With the dataframe underneath I want to optimize the total return, while certain bounds are satisfied. d = {'Win':[0,0,1, 0, 0, 1, 0],'Men':[0,1,0, 1, 1, 0, 0], 'Women':[1,0,1, 0, 0, 1,1],'Matches' :[0,5,4, 7, 4, 10,13], 'Odds':[1.58,3.8,1.95,…
Herwini
  • 371
  • 1
  • 19
11
votes
3 answers

Creating a three-level logistic regression model in pymc3

I'm attempting to create a three-level logistic regression model in pymc3. There is a top level, mid level, and an individual level, where the mid-level coefficients are estimated from top-level coefficients. I'm having difficulty specifying the…
vbox
  • 384
  • 2
  • 10
11
votes
3 answers

Looking for open source naive Bayesian Classifier in C# for a Twitter sentiment analysis project

I've found a similar project here: Sentiment analysis for Twitter in Python . However, I'm working on C# and need to use a naive Bayesian Classifier that is open source in the same language. Unless someone can shed light on how I can utilize a…
youngscientist
  • 171
  • 2
  • 2
  • 5
11
votes
4 answers

Clojure or Scheme bayesian classification libraries?

Any pointers to scheme/racket or clojure bayesian classification libraries? I need one for a toy/learning project that I'm going to do.
Sean T Allen
  • 446
  • 4
  • 12
11
votes
1 answer

NaiveBayes in R Cannot Predict - factor(0) Levels:

I have a dataset looks like this: data.flu <- data.frame(chills = c(1,1,1,0,0,0,0,1), runnyNose = c(0,1,0,1,0,1,1,1), headache = c("M", "N", "S", "M", "N", "S", "S", "M"), fever = c(1,0,1,1,0,1,0,1), flu = c(0,1,1,1,0,1,0,1) ) > data.flu chills…
B.Mr.W.
  • 18,910
  • 35
  • 114
  • 178
11
votes
8 answers

Understanding Bayes' Theorem

I'm working on an implementation of a Naive Bayes Classifier. Programming Collective Intelligence introduces this subject by describing Bayes Theorem as: Pr(A | B) = Pr(B | A) x Pr(A)/Pr(B) As well as a specific example relevant to document…
benmcredmond
  • 1,702
  • 2
  • 15
  • 22
10
votes
1 answer

Coding Custom Likelihood Pymc3

I am struggling to implement a linear regression in pymc3 with a custom likelihood. I previously posted this question on CrossValidated & it was recommended to post here as the question is more code orientated (closed post here) Suppose you have two…
Mike Tauber
  • 137
  • 1
  • 12
10
votes
2 answers

what exactly does 'tf.contrib.rnn.DropoutWrapper'' in tensorflow do? ( three citical questions)

As I know, DropoutWrapper is used as follows __init__( cell, input_keep_prob=1.0, output_keep_prob=1.0, state_keep_prob=1.0, variational_recurrent=False, input_size=None, dtype=None, seed=None ) . cell = tf.nn.rnn_cell.LSTMCell(state_size,…
10
votes
2 answers

How to implement the Bayesian average algorithm for a binary rating system

I have a system where people can up vote or down vote an item and I want to display the results of that as a 5 star rating. I have been trying use the Bayesian Rating algorithm explained here and here with no success. For example: I have three…
gath
  • 24,504
  • 36
  • 94
  • 124
10
votes
2 answers

Bayesian inference

I have an instrument that will either pass or fail a series of three tests. The instrument must pass all three tests to be considered successful. How may I use Bayesian inference to look at the probability of passing each case based on evidence?…
Harry Lime
  • 2,167
  • 8
  • 31
  • 53