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

Visualization of pymc priors

I have using pymc successfully, I believe. However, I would like to be able to visualize or plot a prior disctribution em0 = pymc.Normal('em0',mu=emLog, tau=1./0.3, value=emLog) where emLog is my guess at where to find the center of the…
Ken Dere
  • 1
  • 1
  • 1
0
votes
0 answers

How to fix 'Error in .ValidateHolidayList(holiday.list)' in bsts package R?

When specifying custom holidays in the bsts R package, I get the error Error " .ValidateHolidayList(holiday.list) : all(sapply(holiday.list, inherits, "Holiday")) is not TRUE " Same issue with the example in the vignette. How can I create a valid…
0
votes
1 answer

How to fix tcrossprod error when running Mcmc in R package HMSC

When using the Hmsc package in R (https://github.com/hmsc-r/HMSC), I am getting a consistent error in some (not all) of the examples given in the vignettes as well as my own data. The error happens when running the sampleMcmc() function. I have…
0
votes
1 answer

Hierarchical Mixture Model in Rjags

This is my first time using rjags, and I'm trying to fit some count data Y. I'm using a hierarchical mixture model as follows: Y ~ p*Poisson(N*lambda1) + (1-p)*Poisson(N*lambda2) lambda1 ~ Gamma(a,b) lambda2 ~ Lognormal(c,d) a ~ Gamma(1,1) b ~…
ing
  • 21
  • 3
0
votes
1 answer

How to effectively solve a compound cost function optimisation problem?

I want to solve the following optimization problem with Python: I have a black box function f with multiple variables as input. The execution of the black box function is quite time consuming, therefore I would like to avoid a brute force…
user7468395
  • 1,299
  • 2
  • 10
  • 23
0
votes
0 answers

pymc3: sample error: BrokenPipeError: [Errno 32] Broken pipe

I am new to pymc3 and was trying to write a code to do a simple Bayesian inference with MCMC. But the pm. sample just keep giving me the error: BrokenPipeError: [Errno 32] Broken pipe count_data = np.loadtxt('txtdata.csv') n_count_data =…
0
votes
0 answers

Too many models in BayesFactor

Using the BayesFactor package in R I get an error message according to which the number of models exceeded the default max. According to the package's documentation "An option is included to prevent testing too many models: options('BFMaxModels'),…
Dan Eran
  • 159
  • 1
  • 1
  • 8
0
votes
1 answer

Use of different priors for groups of idepedent variables in a Bayesian Probit regression model (rstanarm)

I am using the Bayesian logistic regression (probit) from the rstanarm package to train a model on default events. As inputs the model accepts some financial ratios and some qualitative data. Is there a way where I can actually regularise the…
Jespar
  • 1,017
  • 5
  • 16
  • 29
0
votes
1 answer

How to implement cross_val_score with BayesianRidge using an unsupervised learning?

I am new with sklearn. My objective is to estimate the score of a dataset using cross_val_score with BayesianRidge estimator. It should be implemented using an unsupervised learning. The code below is taken from sklearn except that the target…
k.ko3n
  • 954
  • 8
  • 26
0
votes
0 answers

Python package for Bayesian optimization among a given set of samples

I have a set of samples and their corresponding target values. Below is the visualization: I am trying to use Bayesian optimization to find the sample with maximum target value. My question is if someone knows a python package that does this. I was…
Blade
  • 984
  • 3
  • 12
  • 34
0
votes
1 answer

Can't work out what is missing from my R function code - stopping it from running well

I'm trying to do Bayesian Occupancy Analysis with site covariates. My first step is making a function. I keep on getting the + in my R console indicating it thinks my code is incomplete. Having ran lines individually I am pretty certain the issue…
chris1
  • 11
  • 3
0
votes
1 answer

Bayesian network calculation

I have a bayesian network like this: The associated probabilities are: Now I want to calculate Pr(Fire =T|Tampering = F, Alarm = T). Using Netica, the value is 1. But how can I manually calculate it?
Alex Wang
  • 411
  • 3
  • 16
0
votes
1 answer

using `proportionBF` to carry out one-sample proportion test (more than two levels)

I want to compute Bayes Factor for one-sample proportion test where the null hypothesis is that- The proportions for the levels for the nominal variable are not different from the theoretical proportions I know how to use proportionBF from…
Indrajeet Patil
  • 4,673
  • 2
  • 20
  • 51
0
votes
1 answer

Hierachical Bayesian Linear Regression using PyMC3 is super slow

I am trying to write some code for implementing HBM in the case of logistic regression using the adults dataset from the UCI repository. I have already written the code, but sampling is super slow, on the order of 107s per sample, for even 64…
Cupitor
  • 11,007
  • 19
  • 65
  • 91
0
votes
1 answer

Solving simple chemical network odes in pymc3 with theano

Im trying to solve a simple chemical network A->B(reaction rate k1) and A1->B(reaction rate k2) with Bayesian inference. My hopes are to get sensitivity analysis of k1 and k2. If A, A1 and B are my constant variables only logical thing would be that…
Noob Programmer
  • 698
  • 2
  • 6
  • 22