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

Metropolis Sampling

I'm working through a book called Bayesian Analysis in Python. The book focuses heavily on the package PyMC3 but is a little vague on the theory behind it so I'm quite confused. Say I have data like this: data = np.array([51.06, 55.12, 53.73, 50.24,…
RSHAP
  • 2,337
  • 3
  • 28
  • 39
4
votes
1 answer

SSVS and spike-slab prior with JAGS

I'm very new to this topic/posting on a discussion board, so I apologize in advance if something is unclear. I'm interested in performing a stochastic search variable seleciton (SSVS) in JAGS. I've seen codes online of people performing SSVS (e.g.…
Tammy
  • 173
  • 9
4
votes
1 answer

Change Prior Pymc3 with from_formula

I'm working on a dataset from Kaggle (the one on Human ressources) I am trying to implement some bayesian statistics (logistic regression) but I don't understand how to change the prior on this model (I want the intercept to be an uninformative…
glouis
  • 541
  • 1
  • 7
  • 22
4
votes
1 answer

How to report with APA style a Bayesian Linear (Mixed) Models using rstanarm?

I'm currently struggling with how to report, following APA-6 recommendations, the output of rstanarm::stan_lmer(). First, I'll fit a mixed model within the frequentist approach, then will try to do the same using the bayesian framework. Here's the…
Dominique Makowski
  • 1,511
  • 1
  • 13
  • 30
4
votes
1 answer

R bnlearn eval inside function

I am using the bnlearn package in R to train a Bayesian network. I have troubles with the following code (slightly modified bnlearn example code): library(bnlearn) data(learning.test) fitted = bn.fit(hc(learning.test),…
Jam
  • 43
  • 2
4
votes
1 answer

What is pm.Normal.dist.logp?

I'm reading Probabilistic Programming and Bayesian Methods for Hackers. In Ch5, it is written that logp = pm.Normal.dist(mu=price_estimate, sd=(3e3)).logp(true_price). What is this? I know pm.Normal() but don't know .dist() and .logp().
user4550164
4
votes
1 answer

Python Hyperparameter Optimization for XGBClassifier using RandomizedSearchCV

I am attempting to get best hyperparameters for XGBClassifier that would lead to getting most predictive attributes. I am attempting to use RandomizedSearchCV to iterate and validate through KFold. As I run this process total 5 times (numFolds=5),…
zad0xlik
  • 183
  • 1
  • 4
  • 14
4
votes
1 answer

CAR model from pymc2 to PyMC3

I'm still a noob in PyMC3, so the question might me naive, but I don't know how to translate this pymc2 code in pymc3. In particular it's not clear to me how to translate the R function. beta = pymc.Normal('beta', mu=0, tau=1.0e-4) s =…
marcodena
  • 550
  • 2
  • 5
  • 15
4
votes
2 answers

Can I set feature priors in sklearn Bayesian classifier?

I have done some simple Bayesian classification X = [[1,0,0], [1,1,0]] ### there are more data of course Y = [1,0] classifier = BernoulliNB() classifier.fit(X, Y) Now I have got some "insider tips" that the first element in every X is more…
dgg32
  • 1,409
  • 1
  • 13
  • 33
4
votes
1 answer

Pymc3 Conditional Posterior Sampling

I want to sample from the posterior distributions in pymc3 but conditional on specific values of certain variables. I see how to sample the posteriors with sample_ppc, but it is unclear how to do this conditionally. Is there a simple way? For…
Ryan
  • 53
  • 5
4
votes
1 answer

Predicting from inferred parameters in pymc3

I am trying to understand this from a non-Bayesian background. In linear regression or blackbox machine learning tools the work flow is something like the following. Get data Prepare data Model data (learn from it [or part of it, the training…
John Smith
  • 81
  • 2
4
votes
1 answer

Laplacian smoothing to Biopython

I am trying to add Laplacian smoothing support to Biopython's Naive Bayes code 1 for my Bioinformatics project. I have read many documents about Naive Bayes algorithm and Laplacian smoothing and I think I got the basic idea but I just can't…
Limin
  • 43
  • 1
  • 3
4
votes
1 answer

Learning to use the Mamba package in Julia

I am trying to learn how to use the Mamba package in Julia for doing Bayesian inference. Though the package is great, as a beginner I find the documentation a bit scarce in information. Hence I am trying to figure out how implement some very simple…
user1438310
  • 787
  • 4
  • 14
4
votes
1 answer

DP-GMM and online cluster assignment

I expected scikit-learn's DP-GMM to allow for online update of cluster assignments given new data, but sklearn's implementation of DP-GMM only has a fit method. My understanding of variational inference is yet unclear and I think that the inability…
rafaelvalle
  • 6,683
  • 3
  • 34
  • 36
4
votes
2 answers

Node inconsistent with parents in JAGS model (R)

I'm new to JAGS, and I'm trying to run a simple logistic regression. My data file is very simple: the response is binary and the one predictor I'm using has three levels. Like this: col1: 1 2 2 2 1 1 1 2 1 2 ... col2: HLL, HLL, LHL, LLL, LHL, HLL…
Guilherme D. Garcia
  • 179
  • 1
  • 3
  • 11