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
5
votes
2 answers

extending burn-in period after JAGS model has been run in runjags for R

The runjags package for R is fantastic. The parallel capabilities and the ability to use the extend.jags function make my life so much better. However, sometimes, after I run a model, I realize the burn-in phase should be have been longer. How can I…
colin
  • 2,606
  • 4
  • 27
  • 57
5
votes
1 answer

sampling a multimensional posterior distribution using MCMC Metropolis-Hastings algo in R

I am quite new in sampling posterior distributions(so therefore Bayesian approach) using a MCMC technique based on Metropolis-Hastings algorithm. I am using the mcmc library in R for this. My distribution is multidimensionnal. In order to check if…
5
votes
0 answers

Multi-armed bandits thompson sampling for non-binary rewards

I use the following line to update my beta distribution in each trial and give arm recommendation (I use scipy.stats.beta) : self.prior = (1.0,1.0) def get_recommendation(self): sampled_theta = [] for i in range(self.arms): …
Wise
  • 628
  • 2
  • 11
  • 25
5
votes
1 answer

Posterior probability with pymc

(This question was originally posted on stats.O. I moved it here because it does relate with pymc and more general matters within it: in fact the main aim is to have a better understanding of how pymc works. If any of the moderators believe it not…
rafforaffo
  • 511
  • 2
  • 7
  • 21
5
votes
1 answer

PyMC3 Gaussian Mixing Model

I've been following the Gaussian mixture model example for PyMC3 here: https://github.com/pymc-devs/pymc3/blob/master/pymc3/examples/gaussian_mixture_model.ipynb and have got it working nicely with an artificial dataset. I've tried it with a real…
Anjum Sayed
  • 872
  • 9
  • 20
5
votes
3 answers

AI / Statistical methods for determining the name of a colour

I'm thinking about writing a little library to make a guess at the name of an (RGB value) colour, from a predetermined list of candidates. My first attempt was based purely on pythagorean distance within the three-dimensional RGB colour space - this…
5
votes
1 answer

Set G in prior using MCMCglmm, with categorical response and phylogeny

I am new to the MCMCglmm package in R, and rather new to glm models in general. I have a dataset of species traits and whether or not they have been introduced outside of their native range. I would like to test whether being introduced (as a binary…
Mila
  • 51
  • 5
5
votes
1 answer

RStan: Specifying a Three-Level Random Slopes Model?

I've been working on a three-level RStan model where repeated broadband measurements (year ID = yrid) are nested within local authorities (LA ID = laid), which are finally nested within regions (region ID = rnid). The (logged)dependent variable is…
Thirst for Knowledge
  • 1,606
  • 2
  • 26
  • 43
5
votes
1 answer

Using the pymc3 likelihood/posterior outside of pymc3: how?

For comparison purposes, I want to utilize the posterior density function outside of PyMC3. For my research project, I want to find out how well PyMC3 is performing compared to my own custom made code. As such, I need to compare it to our own…
Rutger
  • 121
  • 6
5
votes
1 answer

Is there an R package for learning a Dirichlet prior from counts data

I'm looking for a an R package which can be used to train a Dirichlet prior from counts data. I'm asking for a colleague who's using R, and don't use it myself, so I'm not too sure how to look for packages. It's a bit hard to search for, because…
Alex Coventry
  • 68,681
  • 4
  • 36
  • 40
5
votes
1 answer

How to calculate model residuals from MCMCregress

I'm doing classwork using Bayesian inference. For this, I'm using the MCMCregress function, from MCMCpack. The problem comes when I want to get the residuals, because the function doesn't provide them, so I have to calculate them "by hand" (in R).…
user3882027
5
votes
1 answer

pymc MAP warning : Stochastic tau's value is neither numerical nor array with floating-point dtype. Recommend fitting method fmin (default)

I have looked at a similar question here pymc warning: value is neither numerical nor array with floating-point dtype but there are no answers, can someone please tell me whether I should ignore this warning or what to do otherwise ? The model has a…
turing
  • 577
  • 1
  • 4
  • 12
5
votes
1 answer

Select Features for Naive Bayes Clasification in R

i want to use naive Bayes classifier to make some predictions. So far i can make the prediction with the following (sample) code in R library(klaR) library(caret) Faktor<-x <- sample( LETTERS[1:4], 10000, replace=TRUE, prob=c(0.1, 0.2, 0.65, 0.05)…
user3008056
5
votes
2 answers

OpenBUGS error undefined variable

I'm working on a binomial mixture model using OpenBUGS and R package R2OpenBUGS. I've successfully built simpler models, but once I add another level for imperfect detection, I consistently receive the error variable X is not defined in model or in…
sgo
  • 53
  • 1
  • 4
5
votes
2 answers

blindly classifying new trends in incoming data

how do news outlets like google news automatically classify and rank documents about emerging topics, like "obama's 2011 budget"? i've got a pile of articles tagged with baseball data like player names and relevance to the article (thanks,…
Carson
  • 17,073
  • 19
  • 66
  • 87