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

Dirichlet-Multinomial WinBUGS code

I'm trying to code a dirichlet-multinomial model using BUGS. Basically I have 18 regions and 3 categories per region. In example, Region 1: 0.50 belongs to Low, 0.30 belongs to Middle, and 0.20 belongs to High. The list goes on to Region 18 of…
user3764358
  • 41
  • 1
  • 2
4
votes
0 answers

PyMC Robust Linear Regression with Measured Uncertainties

I use least squares regression of data with measured errors in both x and y and use the reduced chi-square (mean square weighted deviation: mswd) as a measure of the fit. However, some of the assumptions for using reduced chi-squared likely are not…
srmulcahy
  • 359
  • 1
  • 3
  • 18
4
votes
1 answer

OpenBUGS Code gives error 'expected a comma'

I am trying to fit a hierarchical model using OpenBUGS, with the following code: model { for( i in 1:n){ tausq[i] <- 1/pow(sigma[i], 2) psi[i] ~ dnorm(psi, tausq) psihat[i] ~ dnorm(psi[i], tausq[i]) } psi ~ dnorm(0, 1000) tausq ~…
Kyle N Payne
  • 79
  • 11
4
votes
1 answer

error message JAGS subset out of range

I am attempting to call the following jags model in R: model{ # Main model level 1 for (i in 1:N){ ficon[i] ~ dnorm(mu[i], tau) mu[i] <- alpha[country[i]] } # Priors level 1 tau ~ dgamma(.1,.1) # Main model level 2 for (j in…
Brett
4
votes
0 answers

Solving the Price is Right

In Chapter 5 of Probabilistic Programming for Hackers, the author proposes the following solution to an instance of The Price is Right, where the goal is to estimate the posterior of the price of the full showcase. As a a contestant of the show,…
Amelio Vazquez-Reina
  • 91,494
  • 132
  • 359
  • 564
4
votes
1 answer

How to calculate log(sum of terms) from its component log-terms

(1) The simple version of the problem: How to calculate log(P1+P2+...+Pn), given log(P1), log(P2), ..., log(Pn), without taking the exp of any terms to get the original Pi. I don't want to get the original Pi because they are super small and may…
wen
  • 1,875
  • 4
  • 26
  • 43
4
votes
1 answer

Getting started with PYMC for linear regression

Thought I'd start off following this example: http://www.databozo.com/2014/01/17/Exploring_PyMC3.html But when I follow the example precisely using pymc 2.3 I get an exit and told that the API has changed UserWarning: The MCMC() syntax is…
dartdog
  • 10,432
  • 21
  • 72
  • 121
4
votes
2 answers

Designing bayesian networks

I have a basic question about Bayesian networks. Let's assume we have an engine, that with 1/3 probability can stop working. I'll call this variable ENGINE. If it stops working, then your car doesn't work. If the engine is working, then your car…
devoured elysium
  • 101,373
  • 131
  • 340
  • 557
4
votes
0 answers

Limit to the number of explanatory variables that R's BMA package can handle?

Using R's BMA (Bayesian Model Averaging) package, I want to run the following code: result = bic.glm(x,y,prior.param = c(1,1,1,1,0.5,1,0.5,0.5,0.5,1,1,1,1,1,0.5,1, 1,1,1,1,1,1,1,1,1,1,1,1,0.5,1), glm.family="gaussian",factor.type=TRUE) When my x…
4
votes
1 answer

Naive Bayes text classifier with features such as hasDate, hasLocation, first word etc

I'm trying to work on a Naive Bayes text classifier. I have already created a bag of words approach in code. In my documents I have noticed many features that are unique to certain classifications. Examples of these features include whether or not…
Benny33
  • 475
  • 1
  • 6
  • 12
4
votes
2 answers

Train skin pixels using Opencv CvNormalBayesClassifier

I'm very new to OpenCV. I am trying to use the CvNormalBayesClassifier to train my program to learn skin pixel colours. Currently I have got around 20 human pictures (face/other body parts) under different light conditions and backgrounds. I have…
Wendy
  • 43
  • 1
  • 3
4
votes
1 answer

Bayesian classification for semi-structured data in Java

I would like to train and use a bayesian classifier for the following situation: Semi-structured data - basically an XML schema Information is contained in multiple plain text fields Some fields / parts of the schema may be repeated an arbitrary…
mikera
  • 105,238
  • 25
  • 256
  • 415
4
votes
2 answers

R: predict.glm equivalent for MCMCpack::MCMClogit

I am running a Bayesian logit with MCMCpack::MCMClogit. The syntax is easy and follows lm() or glm(), but I can't find any equivalent of the predict.glm function. Is there any way of predicting the probabilities of the outcomes in MCMClogit for each…
user702432
  • 11,898
  • 21
  • 55
  • 70
3
votes
3 answers

Naive Bayes classifier using python

I'm using scikit-learn for finding the Tf-idf weight of a document and then using the Naive Bayesian classifier to classify the text. But the Tf-idf weight of all words in a documents are negative except a few. But as far as I know, negative values…
jvc
  • 604
  • 2
  • 12
  • 33
3
votes
1 answer

Apply Bayesian average in a NON 5-star rating system

I am looking forward to apply the bayesian approach to prioritize a list that could take the number of likes, dislikes and review counts into consideration. The approach listed in here relies on the bayesian average: $bayesian_rating = (…
ebil
  • 33
  • 4