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

Unable to perform Bayesian analysis on data through jags in R

Here's my code library(R2jags) #library(rjags) library(bayesplot) library(coda) # set working directory setwd("/Users/isa/Desktop/logreg") # BUGS model code cat("model { for( i in 1 : 8 ) { y[i] ~ dbin(theta[i],n[i]) logit(theta[i]) <-…
0
votes
0 answers

Execution time rBayesianOptimization

Is there an option to set the rBayesianOptimization runtime. It would be very useful to be able to stop it when there is no convergence. Thank you. RBayesianOptimization Documentation
0
votes
1 answer

Conditional Probability for fake reviews

I am working on a conditional probability question. A = probability of being legit review B = probability of guessing correctly P(A) = 0.98 → P(A’) = 0.02 P(B|A’) = 0.95 P(B|A) = 0.90 The question should be this: P(A’|B) =? P(A’|B) = P(B|A’).P(A’)…
user11866342
0
votes
1 answer

Bayesian update in pymc3: adding more data doesn't work

I am new to pymc3, but I've heard it can be used to build a Bayesian update model. So I tried, without success. My goal was to predict which day of the week a person buys a certain product, based on prior information from a number of customers, as…
user3490622
  • 939
  • 2
  • 11
  • 30
0
votes
0 answers

Baysian multivariate linear regression using bas.lm() in r

spr_bas <- bas.lm(spr ~ ., data = sp500, method = "MCMC", prior = "ZS-null", modelprior = uniform()) I want to use bas.lm() to run a bayesian linear regression with…
Grace
  • 173
  • 2
  • 10
0
votes
1 answer

Making a for loop for two variables in R

I have a dataset on fecal egg counts (FEC) in sheep and would like to test the effect of different treatments. I have 120 farms treated with combination of different drugs. I am using the "eggcount" package that is based on the Bayesian approach to…
Ahmad
  • 3
  • 3
0
votes
0 answers

sourcing files to R script for MCMC (Bayesian Statistics) Analysis in R

I'm trying to run a Linear Regression Bayesian Anaylysis. I'm trying to source a file Jags.R but I keep encountering errors that I'm unable to solve. Here is the main code myData = read.csv(file="HeightWeightData.csv" ) xName = "height" ; yName =…
Rspacer
  • 2,369
  • 1
  • 14
  • 40
0
votes
1 answer

GLM posterior predictive not plotting over complete range of data

[I ][1] I can not figure out why the glm posterior predictive is not plotting over the entire data, but only over a fraction of it. And there seem to be no parameters which can alter these. This is the code which generates the following problematic…
Ayush Sahu
  • 43
  • 3
0
votes
0 answers

Error in Bayesian network algorithm: Monty Hall problem using Python

import math from pomegranate import * import pomegranate as pg guest= pg.DiscreteDistribution({'A':1./3,'B':1./3,'C':1./3}) prize= pg.DiscreteDistribution({'A':1./3,'B':1./3,'C':1./3}) monty=pg.ConditionalProbabilityTable( [['A','A','A',0.0], …
0
votes
1 answer

How does R make predictions using Bayesian regression models?

I built a Bayesian regression model in R and I'm trying to use it to make predictions from a record X that's not in the training set. The problem is, no matter how I change the values of one of the independent variables in X, the prediction remains…
Chris J
  • 23
  • 3
0
votes
0 answers

Updating a simple bayesian model with a set of new data coming in every 10 minutes in Python

I am new with Bayesian Inference in Python and I wish to perform Bayesian updating with new data every time it is generated (10-min frequency). This means I will not perform it on a known set of data but update the model with singular datum every…
mats_snaps
  • 57
  • 6
0
votes
3 answers

How to iterate an equation in a python function, using the previous result for each iteration

I'm trying to make a function to calculate Bayesian probabilities in python without using scipy, and while I can get the function to print a single result, I'm having trouble getting it to iterate multiple times, using the previous result in the…
ekselan
  • 137
  • 1
  • 10
0
votes
0 answers

Bayesian parametric survival analysis

Hello Stackoverflowers, I have been working on the equation found in the book: Bayesian survival analysis by Joseph Ibrahim 2001 (Chapter parametric models p40-42). I manage to get a model going with a truncated gamma distribution in R but for the…
0
votes
0 answers

Why is lmBF function in R giving me different results at each run?

I am running a linear mixed model analysis, in which I have a dependent variable(pupil mean), two fixed factors (condition and phase type) and one random factor (subj). I want to compute the related bayes factor with lmBF function of the BayesFactor…
0
votes
1 answer

PYMC3 - Random Walk Forecasting

I was hoping someone may be able to clarify something for me. I am trying to do a timeseries forecasting with the GaussianRandomWalk function in PyMC3. I have been suggested that my code is wrong as I’ve modeled it so that the standard deviation of…
Bjorn
  • 1