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
6
votes
1 answer

Bayesian Optimisation applied in CatBoost

This is my attempt at applying BayesSearch in CatBoost: from catboost import CatBoostClassifier from skopt import BayesSearchCV from sklearn.model_selection import StratifiedKFold # Classifier bayes_cv_tuner = BayesSearchCV( estimator =…
prp
  • 914
  • 1
  • 9
  • 24
6
votes
0 answers

PyMC: multiple time series observations (adaptation of text message example from "Bayesian Methods for Hackers")

I'm trying to adapt the text message example from Cameron Davidson-Pilon's Bayesian Methods for Hackers, Chapter 1, "Introducing our first hammer: PyMC" to handle multiple observations. The solution below appears to be working, but I'm new to pymc…
ToddP
  • 652
  • 13
  • 18
6
votes
2 answers

Heatmap of regression lines

Suppose I run a bayesian simple linear regression. I would like to visualise the results by plotting multiple regression lines based on the posterior distributions of a (intercept) and b (slope). I am wondering how to display the results in a…
beginneR
  • 3,207
  • 5
  • 30
  • 52
6
votes
1 answer

PHP implementation of Bayes classificator: Assign topics to texts

In my news page project, I have a database table news with the following structure: - id: [integer] unique number identifying the news entry, e.g.: *1983* - title: [string] title of the text, e.g.: *New Life in America No Longer Means a New Name* …
caw
  • 30,999
  • 61
  • 181
  • 291
6
votes
1 answer

Inference in a Bayesian Network

I need to perform some inferences on a Bayesian network, such as the example I have created below. I was looking at doing something like something like this to solve an inference such as P(F| A = True, B = True). My initial approach was to do…
suphug22
  • 181
  • 1
  • 8
6
votes
1 answer

Modified BPMF in PyMC3 using `LKJCorr` priors: PositiveDefiniteError using `NUTS`

I previously implemented the original Bayesian Probabilistic Matrix Factorization (BPMF) model in pymc3. See my previous question for reference, data source, and problem setup. Per the answer to that question from @twiecki, I've implemented a…
Mack
  • 2,614
  • 2
  • 21
  • 33
6
votes
1 answer

Bayesian Probabilistic Matrix Factorization (BPMF) with PyMC3: PositiveDefiniteError using `NUTS`

I've implemented the Bayesian Probabilistic Matrix Factorization algorithm using pymc3 in Python. I also implemented it's precursor, Probabilistic Matrix Factorization (PMF). See my previous question for a reference to the data used here. I'm having…
Mack
  • 2,614
  • 2
  • 21
  • 33
6
votes
1 answer

Detecting unknown class in a bayes classifier

If you have a bayes classifier trained for a set of classes, how to detect if the output is significant enough to choose a class? It would be useful for detecting samples wich can't be asigned to a class. I have tried testing if the class…
piotr
  • 5,657
  • 1
  • 35
  • 60
6
votes
1 answer

Text classification in python - (NLTK Sentence based)

I need to classify text and i am using Text blob python module to achieve it.I can use either Naive Bayes classifier/Decision tree. I am concern about the below mentioned points. 1) I Need to classify sentences as argument/ Not an argument. I am…
6
votes
3 answers

Porting pyMC2 Bayesian A/B testing example to pyMC3

I am working to learn pyMC 3 and having some trouble. Since there are limited tutorials for pyMC3 I am working from Bayesian Methods for Hackers. I'm trying to port the pyMC 2 code to pyMC 3 in the Bayesian A/B testing example, with no success. From…
Eoin
  • 63
  • 3
6
votes
1 answer

Regression using PYMC3

I posted a IPython notebook here http://nbviewer.ipython.org/gist/dartdog/9008026 And I worked through both standard Statsmodels OLS and then similar with PYMC3 with the data provided via Pandas, that part works great by the way. I can't see how to…
dartdog
  • 10,432
  • 21
  • 72
  • 121
6
votes
1 answer

Document Term Matrix for Naive Bayes classfier: unexpected results R

I'm having some very annoying problems getting a Naive Bayes Classifier to work with a document term matrix. I'm sure I'm making a very simple mistake but can't figure out what it is. My data is from accounts spreadsheets. I've been asked to figure…
forestfanjoe
  • 412
  • 4
  • 11
6
votes
2 answers

Alternatives to Naive Bayes algorithm

We're trying to implement a semantic searching algorithm to give suggested categories based on a user's search terms. At the moment we have implemented the Naive Bayes probabilistic algorithm to return the probabilities of each category in our data…
Fogmeister
  • 76,236
  • 42
  • 207
  • 306
6
votes
1 answer

Naive Bayesian and zero-frequency issue

I think I've implemented most of it correctly. One part confused me: The zero-frequency problem: Add 1 to the count for every attribute value-class combination (Laplace estimator) when an attribute value doesn’t occur with every class value. Here's…
Science_Fiction
  • 3,403
  • 23
  • 27
6
votes
1 answer

OpenBUGS fails to converge on model that converges in WinBUGS. Precision limit?

As the title of this post says, when I try to run code and data that work fine in WinBUGS from R using BRugsFit (with coda=T), I get these errors: Error in glm.fit(x = structure(c(1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, : NA/NaN/Inf in foreign…
bokov
  • 3,444
  • 2
  • 31
  • 49