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

How to avoid overdispersed Poisson regression overfitting?

I have a dataset including three variables including company id (there are 96 companies), expert id (there are 38 experts) and points given by experts to companies. Points are discrete values from 0 to 100. I tried fitting an overdispersed poisson…
Amin Shn
  • 532
  • 2
  • 11
0
votes
3 answers

Best possible way to add the likely event and its probability from a cross table in R

Using the mtcars dataset, I have created a cross table as follows - tab = with(mtcars, ftable(gear, cyl)) tab Here is how it looks - cyl 4 6 8 gear 3 1 2 12 4 8 4 0 5 2 1 2 For this crosstable, I…
Saurabh
  • 1,566
  • 10
  • 23
0
votes
1 answer

Request to help understand an apparent discrepancy between tidybayes::add_predicted_draws and brms::posterior_predict

I am using the Howell1 dataset from rethinking package. require(cmdstanr) require(brms) require(tidybayes) data("Howell1") d <- Howell1 d2 <- d[d$age > 18,] d2$hs <- (d2$height - mean(d2$height))/ sd(d2$height) d2$ws <- (d2$weight -…
Srivatsa Srinath
  • 177
  • 2
  • 10
0
votes
0 answers

Bayesian Optimization in Python makes more iterative than specified

I'm using Python bayesian-optimization to optimize an XGBoost model. I specified the number of iteration as 10: from bayes_opt import BayesianOptimization . . . optimizer = BayesianOptimization( f=my_xgb, pbounds=pbounds, verbose=2, …
user88484
  • 1,249
  • 1
  • 13
  • 34
0
votes
0 answers

"Error: Attempt to redefine node" in Mixture that changes size every iteration

My data has three columns Time, Interval, Count. I have a mixture of Poissons that goes like this mod_string = " model{ for(i in 2:length(Count)){ Count[i] ~ dpois(lambda.hacked[i]*z[i]+0.0001) z[i] ~dbern(p) lambda.hacked[i] <- mu[ clust[i]…
A Doe
  • 301
  • 2
  • 14
0
votes
0 answers

Predict values from complex Rjags model

It's the first time I'm working with R2Jags, MCM chains and Bayesian models and I'm having trouble to compute the predicted values for my model. The model is based on research by Hallmann et al. 2017…
L.Thoma
  • 23
  • 6
0
votes
1 answer

Problem with calculating probability values in python

This code is a part of bayesian classifier application with python. I'm trying to calculate probability of each word with respect to each class. word_prob variable here, multiplies all the probabilities for each class (we have 6 classes here). When…
samiravz
  • 49
  • 7
0
votes
0 answers

Unstable results from Bayesian statistical approach(pymc3)

Studying Bayesian statistical approach I have found that my model gives unstable results. I have made a lot of experiments with different samplers(Metropolis and NUTS) and model parameters - tune and draws. Apart from the fact that I know the…
Roman Kazmin
  • 931
  • 6
  • 18
0
votes
1 answer

jags bayesian linear regression, how can i set priors when the priors are dependent each other?

library(rjags) jags_code = "model{ for (i in 1:n){ Y[i] ~ dnorm(mu[i], tau) mu[i] <- beta0 + beta1*x[i]} beta0 ~ dnorm(0,0.001) beta1 ~ dnorm(0,0.001) eta <- dgamma(0.1/2, 0.1/2) tau ~ dgamma(5/2, 5*eta/2)" jags_data = list(x = c(5,1,2,3,4), …
jjw
  • 481
  • 1
  • 4
  • 14
0
votes
1 answer

JAGS recursive model

I am new to bayesian statistical analysis with JAGS/WinBUGS/STAN languages. I am trying to fit an extended SIR model, it seems the error is located in line 2 since I always get the warning: "Error parsing model file: syntax error on line 2 near…
Ajam
  • 1
0
votes
1 answer

Pystan, Runtime error - Initialization failed

I'm trying to develop a Bayesian model using Pystan. I'm able to compile the model successfully. But when I'm sampling data I'm getting run time error. Refer to the code below: my_code = ''' data { int N; int K1; int K2; real…
Niha K
  • 21
  • 3
0
votes
0 answers

How to plot Bayesian Lasso beta coefficients

I'm trying to reproduce the graphics similar of Park and Caella (The Bayesian Lasso - 2008) in R, but the structure of the Bayesian Lasso is different of the Ordinary Lasso. I found how to plot lasso beta coefficients (it's perfect!) but I would…
0
votes
1 answer

Bayesian network probabilities

I don't really know if that is appropriate here but I have a mathematical problem linked to IA to solve and it sounds easy but I have issues to do it. Basically, I'm working on Bayesian Networks and here are the definitions that the teacher gave…
Loïc Dubois
  • 142
  • 9
0
votes
1 answer

Create a function to calculate Bayes Probability in R

I'm working on a project and i need to create a function in R to calculate the following probability : P(Y|X) = P(Y and X) / P(X) by using table and prop.table Any idea please.
SYB
  • 107
  • 8
0
votes
0 answers

Bayesian Question: Exponential Prior and Poisson Likelihood: Posterior?

I am needing assistance in a particular question and need confirmation of my understanding. The belief is that absences in a company follow a Poisson(λ) distribution. It is believed additionally that 75% of thes value of λ is less than 5 therefore…
SMCC9145
  • 3
  • 2