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

plotting the posterior distribution of N given likelihood and prior

Given that the likelihood is Y|n~Binomial(n, theta) and the prior is n~Poisson(5), I tried to calculate the posterior distribution of sample size n with Y=0 and theta=0.2. My code is as follows: Y <- 0 theta <- 0.2 n_grid <-…
0
votes
1 answer

How can I add labels in a plot where I've used the function `plot` and `points`?

How can I add labels in a plot where I've used the function plot and points? I have the following code x<-seq(0,1,.01) alpha=2 beta=3 y<-dbeta(x,alpha,beta) plot(x,y,ylim=c(0,5.9)) n=10 y1<-dbeta(x,alpha+x,beta+n-x) …
user9802913
  • 245
  • 4
  • 20
0
votes
1 answer

Compute the Bayes factor of an A/B test dataset in r

I am trying to compute the Bayes factor of an A/B test dataset that can be found here. However, I end up with a NaN because the beta coefficient evaluates to zero. In calculating the likelihoods, I am assuming that it follows the binomial…
Salma Bouzid
  • 65
  • 1
  • 9
0
votes
1 answer

Having trouble with Bayesian Inference model - JAGS with R

I've been trying to reproduce the results of the following paper using R and JAGS with no success. I can get the model to run, but the results shown are consistently different. Link for the paper:…
0
votes
0 answers

Bayesian ARIMA model in Python

In reaction to Sorry ARIMA, but I'm going Bayesian I was searching the Internet for a while but could not find any material regarding Bayesian ARIMA models in Python. Do you have any experience with this?
Septinel
  • 23
  • 4
0
votes
1 answer

How to calculate 95% confidence intervals using bayesboot()

I need help to calculate bootstrap-based credible intervals of the quantity qtt.ci from my regression coef.def. So far my attempts have resulted in: Error in quantile.default(s, c(0.025, 0.25, 0.5, 0.75, 0.975)) : missing values and NaN's not…
0
votes
1 answer

"mean of multivariate normal Y[1,1] must have the same number of components as Y[1,1]" - Error in WinBUGS

How to deal with compilation error which says: "mean of multivariate normal Y[1,1] must have the same number of components as Y[1,1]"? Here are my code and data in WinBugs: model{ for (i in 1:10){ Y[i, 1:8] ~ dmnorm(mu[,], Omega[ , ]) …
Lucifer
  • 117
  • 8
0
votes
1 answer

Multi Threading in C++ Windows

I am using the pystan module in Windows where multithreading is not supported on Windows in the module. The pystan module is partially written in C++ and since I am trying to decrease the run time of the module, I am wondering if there is a way to…
nik jacks
  • 75
  • 1
  • 5
0
votes
1 answer

Why does Rjags throws "Unknown variable mu.fine"? Rjags error

I'm currently trying to develop a model in JAGS, but I unfortunately keep getting the following error: Error in jags.model("ref_model.txt", data = ref.data.jags, inits = inits3, : RUNTIME ERROR: Compilation error on line 26. Unknown variable…
Camilo
  • 1
0
votes
1 answer

R fails to recognize variable, not sure why

I am currently using R studio, and downloaded the 'brms' package, for those who are familiar with it. I wanted to create a code which loaded a data set, ran a poisson transformation on it, and coded the transformation as a different…
aiyer1217
  • 1
  • 1
0
votes
1 answer

Weka: why getMargin returns all zeros?

I am using Weka Java API. I trained a Bayesnet on an Instances object (data set) data. /** * Initialization */ Instances data = ...; BayesNet bn = new EditableBayesNet(data); SearchAlgorithm learner = new TAN(); SimpleEstimator estimator = new…
Mark Jin
  • 2,616
  • 3
  • 25
  • 37
0
votes
1 answer

Weka API: How to obtain a joint probability, e.g., Pr(A=x, B=y), from a BayesNet object?

I am using Weka Java API. I trained a Bayesnet on an Instances object (data set) with class (label) unspecified. /** * Initialization */ Instances data = ...; BayesNet bn = new EditableBayesNet(data); SearchAlgorithm learner = new…
Mark Jin
  • 2,616
  • 3
  • 25
  • 37
0
votes
1 answer

concurrent.futures with multinest

What is the best python based multinest package that optimizes for multi processing with concurrent.futures? I've had issues getting multicast to use all of my CPUs with anything but multiprocessing.pool; but the python multinest operations seem to…
0
votes
0 answers

Errors in BUGS model

I'm attempting to run this BUGS model, but am running into some errors. Any help would be greatly appreciated. model { for (i in 1:n){ y[i] ~ dnorm (a[state[i]] + theta*treat[i] + b*hispanic, tau.y) } theta ~ dnorm (0, .0001) b ~…
0
votes
1 answer

GPyOpt iteratively finding the maximum target function value; retrieve suggested next location

I just started to use GPy and GPyOpt. I aim to design an iterative process to find the position of x where the y is the maximum. The dummy x-array spans from 0 to 100 with a 0.5 step. The dummy y-array is the function of x-array. The true function…
Chenyang
  • 161
  • 1
  • 11
1 2 3
99
100