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
0
votes
0 answers

Problem with type FreeRV while adding new distribution

I'm trying to add a new discrete distribution to PyMC3 (a Wallenius non-central hypergeometric) by wrapping Agner Fogs c++ version of it (https://www.agner.org/random/). I have successfully put the relevant functions in a C++ extension and added…
0
votes
0 answers

Having troubles with understanding pymc3 package

I have this example code that i am using in python with pymc3 package import pymc3 import numpy as np size = 100 # Predictor variable X1 = np.random.randn(size) X2 = np.random.randn(size) * 0.2 X3 = np.random.randn(size) * 2 alpha, sigma = 1,…
Noob Programmer
  • 698
  • 2
  • 6
  • 22
0
votes
1 answer

How to calculate marginal likelihood in Python with PyMC 2.3.7?

I would like to calculate the marginal likelihood of a model given a dataset in order to compare it with another, thanks to the Bayes factor. I used PyMC 2 to get the post distributions of each parameter for each model. Here is the principle (I…
0
votes
1 answer

BayesFactor anovaBF syntax

I want to get Bayes factors for ANOVAs that are analogous to the classical F-tests, and I just want to make sure I understand correctly how to write the syntax, especially regarding subject IDs. For example, I have between-subject independent…
gaspar
  • 898
  • 1
  • 13
  • 26
0
votes
0 answers

Scales of plots in pymc

I would like to have probability instead of frequency in the vertical axis of my traceplot in PyMC. How is it possible to set? The examples are in the photos. I realize it is easy to transform by dividing it by the number of samples, but is it…
Akim Tsvigun
  • 91
  • 1
  • 8
0
votes
1 answer

Dirichlet parameters don't update in JAGS

I am trying to run a hierarchical Dirichlet model in JAGS but I have no update and must do something wrong. I try to approximate it with the gamma distribution: #Creating some…
0
votes
1 answer

Code for Basic Hierarchical Bayesian Analysis

I have this code written in winBUGS: n <- 100 x1 <- rbinom(n,1,.7) x2 <- rbinom(n,1,.5) sum(x1) sum(x2) model{ x1 ~ dbin(p1, n) x2 ~ dbin(p2, n) p1 ~ dbeta(a1, b1) p2 ~ dbeta(a2,b2) diff <- p1 - p2 p.value <- step(diff) } list(n = 100, x1 =…
0
votes
1 answer

Bayesian Network Key Benefit

I have some trouble understanding the benefits of Bayesian networks 100%. Am I correct that the key benefit of the network is, that one does not need to use chain rule of probability in order to calculate joint distributions? So using the chain…
0
votes
0 answers

Pyro: Simple inverse graphics example using SVI not working

I'm new to pyro and trying to implement a simple inverse graphics problem involving estimating the coordinates of the points of a triangle rendered on a black & white 32x32 image. So I defined a generative model that generates 3 uniformly random…
0
votes
2 answers

CRAN package with Bayesian logistic regression via Polya-Gamma scheme

I am maintaining a package that uses BayesLogit for Bayesian Logistic regression using the Polya-Gamma latent variable technique and return samples from a Markov Chain-Monte Carlo (MCMC). BayesLogit is no longer on CRAN and I can install a previous…
miguelmorin
  • 5,025
  • 4
  • 29
  • 64
0
votes
1 answer

Causal Impact package: Calculate posterior tail-area probability from model estimates

I am currently using the CausalImpact package for some research and in this context I need to know and be able to explain, how the posterior tail-area probability is calculated in order to reproduce that value for validation purposes. Does anyone…
Tiko
  • 1
  • 1
0
votes
0 answers

How to correct multiple gaussian variables, given the stability analysis of their structure?

We have multiple Gaussian variables, which could be the locations of 2-d points. Suppose the 2-d points are measured independently. If we connect the adjacent points, then we will get a structure (graph). Suppose we have a model to compute whether…
0
votes
0 answers

How to predict probability of each class by using naive bayes?

My question is about baysian theory. I want to predict probability of each class by naive bayes. In my case ,class is three (YES,NO,UNKNOWN), and prior probability is almost same (0.33,0.33.0.34). However, Data does not include one class…
beginner
  • 13
  • 6
0
votes
1 answer

Explanation of plotting Bayesian prior and posterior distributions in one panel using R

Could someone explain with details how this code is working? require(lattice) ?lattice # essential reading data <- dgamma(seq(from=0.00001,to=0.01,by=0.00001),shape = .1, scale = .01) dfrm <- data.frame(dgam = data, param="s.1.01") dfrm <-…
user9802913
  • 245
  • 4
  • 20
0
votes
2 answers

Why this boolean is in this bayes classifier? (Python question?)

I'm studying GANs (and I'm a beginner in python) and I found this part of the code in the previous exercises that I don't understand. Concretely I don't understand why is used the boolean of the 9th line (Xk = X[Y == k]) for the reasons that I write…
AMGMNPLK
  • 1,974
  • 3
  • 11
  • 22