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

Softmax Regression (Multinomial Logistic) with PyMC3

I am trying to implement a logistic multinomial regression (AKA softmax regression). In this example I am trying to classify the iris dataset I have a problem specifying the model, I get an optimization error with find_MAP(). If I avoid using…
aloctavodia
  • 2,040
  • 21
  • 28
4
votes
1 answer

What are the interval transforms in pymc3 for uniform distributions?

I've noticed that when using uniform distributions in pymc3, the sampler also scans over an _interval parameter as well unless a transform is specified for example: with fitModel6: normMu = pm.Uniform('normMu',lower=0,upper=1000) will result…
J. Michael
  • 41
  • 4
4
votes
0 answers

bayesian network learning and inference in R for continuous variables

How can I do bayesian structure learning and inference for continuous variables with R? I was using the 'bnlearn' package as follows: For structure learning using the Hill Climbing algorithm , I do the following mynetwork =…
tubby
  • 2,074
  • 3
  • 33
  • 55
4
votes
1 answer

What is the difference between a Decision Tree and a Bayesian Network?

If I understand it right, both use Bayes Theorem to generate an acyclic graph and calculate percentages based on functions applied at every node. What is the difference?
iceburn
  • 987
  • 3
  • 13
  • 16
4
votes
1 answer

Having Trouble Normalizing Posterior Distribution in Python

I am coding the derivation of a Dirichlet-Multinomial posterior in a paper that I've read and I am having trouble getting the distribution to sum to 1. Here is the code in its unsimplified form: def pcn(X, n, N, c, alpha): pnc =…
4
votes
2 answers

How to combine the outputs of multiple naive bayes classifier?

I am new to this. I have a set of weak classifiers constructed using Naive Bayes Classifier (NBC) in Sklearn toolkit. My problem is how do I combine the output of each of the NBC to make final decision. I want my decision to be in probabilities and…
4
votes
2 answers

Ranking Contest Results of Images with 5-Star Ratings

I run a calendar photo contest that uses a 5-star rating system which ranks the images according to their average rating. However, I would like to factor in the total number of votes a photo receives to get a more accurate ranking. For example, I do…
Djeep
  • 41
  • 4
4
votes
1 answer

Linear regression with pymc3 and belief

I am trying to grasp Bayesain statistics with pymc3 I ran this code for a simple linear regression #Generating data y=a+bx import pymc3 import numpy as np N=1000 alpha,beta, sigma = 2.0, 0.5, 1.0 np.random.seed(47) X = np.linspace(0, 1, N) Y = alpha…
Uri Goren
  • 13,386
  • 6
  • 58
  • 110
4
votes
1 answer

Is PyMC3 useful for creating a latent dirichlet allocation model?

I've spent the last several weeks trying to learn PyMC whereby my main task is using it to build an LDA topic model. I originally tried this example with PyMC2.3 https://stats.stackexchange.com/questions/104771/latent-dirichlet-allocation-in-pymc…
Chris
  • 676
  • 5
  • 20
4
votes
0 answers

Why am I getting "Error in handleRes(res) : NA" when running bugs() with syntactically correct model?

I'm trying to run a bayes model through R using R2WinBugs and BRugs but running into an error which I cannot solve. I've checked that my model is syntactically correct, and this is the output from when I try running (example below): model is…
Polly
  • 41
  • 4
4
votes
0 answers

Error in Hierarchical Bayesn in R : Bayesn Package

Disclosure: I have just started my career in Analytic and have basic knowledge about statistics. Hi, I am trying to execute HB analysis in R using the function rhierMnlRwMixture in the Bayesm Package. I have used the optfederov function in Algdesign…
4
votes
1 answer

pymc normal prior + normal likelihood does not converge correctly?

I am new to pymc and bayesian statistics. Here I am trying to implement an extremely simple pymc model in order to compare with the theoretical result. In my test case, I assumed a normal prior as mu~N(20,20) and a likelihood assumed to be…
hdragon
  • 41
  • 1
4
votes
2 answers

Weighted Average and Ratings

Maths isn't my strong point and I'm at a loss here. Basically, all I need is a simple formula that will give a weighted rating on a scale of 1 to 5. If there are very few votes, they carry less influence and the rating pressess more towards the…
Danten
  • 570
  • 6
  • 17
4
votes
0 answers

Comparing two biased coins (newbie example from Kruschke book)

I'm an absolute newbie to Bayesian stats and MCMC, so I'm working my way through "Doing Bayesian Data Analysis: A Tutorial with R and BUGS" by John Kruschke. To test my understanding, I'm trying to translate his examples from BUGS to PyMC. In Ch.…
Ian Davis
  • 41
  • 2
4
votes
0 answers

How can the prior probabilities manually set for the Naive Bayes clf in scikit-learn?

How can I assign "custom" prior probabilities to the Bayes rule in the naive Bayes classifier in scikit? For simplicity, let's take the Iris dataset for example, where we have 150 samples and 3 different classes with 50 samples per class. I assume…
user2489252