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 specify priors distributions for variable transformation parameters in rstanarm which are external to the model?

Suppose, the response y can be modeled by the following generic equation: y = a + b1*x1, where x1 = func(p,q,r) Standard functions provided by rstanarm allow to specify the prior distributions for the coefficients (b1) and intercept (a). Do…
0
votes
1 answer

Iterating over each Row of a large dataset R-Studio

Suppose I have a list of 1500000 states with given zip codes and I want to run my predictor Model (databas) on that list and get the predictions of Area, I did the same by the help of one gentleman and here is my code: pred <- sapply(1:nrow(first),…
0
votes
1 answer

Bayesian Modelling in R

I am trying to implement a bayesian model in R using bas package with setting up these values for my Model: databas <- bas.lm(at_areabuilding ~ ., data = dataCOMMA, method = "MCMC", prior = "ZS-null", modelprior = uniform()) I am trying to predict…
0
votes
0 answers

How to simulate normal Bayesian posterior from normal prior in pymc3?

I'm studying Bayesian statistics and I'm trying to estimate the mean of a normal distribution given a normal prior and data which are normally distributed. I have formulas to compute the posterior distribution analitically but I want to solve it by…
0
votes
1 answer

How to do MCMC inference for COVID on R

I would like to do a standard SEIR model for the COVID pandemic on R. I have number of cases, deaths and daily cases (incidence). Adopting a Bayesian framework, I would like to calibrate and forecast the model using simple MCMC. Having consulted…
user13675490
0
votes
0 answers

I am not able to bucketize a given double value in Java

I have been trying to code the Bayes Classifier for a few days in Java. I downlaoded the Iris-Dataset (https://www.kaggle.com/uciml/iris) for this. I wrote the code for loading the dataset (I converted the .csv file to .txt). It works fine. Then for…
0
votes
0 answers

How to calculate Bayesian model selection with Python's pymcmcstat library

I am lost within the pymcmcstat documentation of Python. I managed to plot the parameter distributions etc, but when it comes to the Bayes factor, I need to calculate the integral over the parameter space of likelihood for each model. I followed…
Bsn_eng
  • 1
  • 1
0
votes
1 answer

How to specify "strict" priors for fixed coefficients in rstanarm?

How do I provide a prior distribution for a coefficient with mean in the range 1e-05 and standard deviation (sd) in the range 1e-06? What are the distributions to choose for such high precision (sd <= 1e-06) parameters in rstanarm? 1) Student t…
0
votes
1 answer

binomial regression with group effects

I am trying to build a binomial regression model with rstan. The aim is to get the effect size bt between two conditions X in a group t in total and the effect size btg for subgroups g. library(rstan) df <-…
kEks
  • 304
  • 1
  • 9
0
votes
1 answer

What is the differnce between simulation and estimation in bayesian statistics?

Can someone help me understand the difference between simulation and estimation of different Bayesian statistical methods like MCMC or metropolis-hasting etc.
Nikhil Dupally
  • 753
  • 1
  • 4
  • 12
0
votes
0 answers

How to multiply matrix of predictors by parameter vector in ulam interface (rethinking R package)

I am reading Statistical Rethinking (2nd edition) from Richard McElreath and in the 4th chapter there is example of B-Spline, which is solved by quap (quadratic approximation) and I would like to solve it by ulam (HMC). data("cherry_blossoms") d =…
0
votes
1 answer

"rstanarm does not permit formulas with duplicate group-specific terms", how do I fix this?

While trying bayesian approach on regression models using "rstanarm", duplicate group specific terms are not allowed. Is there any solution for this? Formula = "SleepTime ~ 1 + WorkingHours + (1 + WorkingHours | JobClass) + Tenure + (1 + Tenure |…
0
votes
2 answers

updating a rating based on previous rating in some series data set

Let say, I have 3-time series. with value of a = [1, 2, 4, 5, 3, 1 ] b = [3, 5, 2, 9, 3, 1] c = [2, 5, 6, 7, 3, 1] now I want to rate the deviation of values from each time series. for example, 2nd values of all-time series 2, 5, 5, and it "mean"…
0
votes
0 answers

For Prior definition in bayesian regression with R package MCMCglmm, how to convey different strength of believe via parameter nu?

I understand the strength of the Prior is set via parameter nu however, I can not find information what nu expresses in statistical terms, e.g. how strong would a prior that is similar to the number of variables x be in this example? #Inverse…
0
votes
1 answer

Bayesian IRT Pymc3 - Parameter inference

I would like to estimate IRT model using PyMC3. I generated data with the following distribution: alpha_fix = 4 beta_fix = 100 theta= np.random.normal(100,15,1000) prob =…
Pbcacao
  • 35
  • 4