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

Using CPnest to calculate Bayes Theorem evidence, receiving AttributeError: 'MetropolisHastingsSampler' object has no attribute 'thread_id'

I am currently trying to use CPnest to calculate some evidences for given a data set (Bayesian statistics) Upon my first running of the code, I received the error RuntimeError: Attempt to start a new process before the current process …
0
votes
1 answer

Fill stat_ecdf with two different colors

I'm doing for class hypothesis contrast with bayesian models. And I want to do a fancy graphic with ggplot showing the two hypothesis regions with two different colours. Normal distribution I would like to fill region H1 with different colour of…
0
votes
1 answer

Bayesian Time Series Analysis with MCMC using the Function bsts() in the bsts Package

Problem: I have a data frame called FID (see below) that contains two columns for Year & Month, and Sighting_Frequency. The data frame contains 3 years of observations between 2015-2017, indicating I have 36 months of data. I want to run a Bayesian…
Alice Hobbs
  • 1,021
  • 1
  • 15
  • 31
0
votes
0 answers

How to define a Rayleigh Prior in Pymc3?

I would like to define a Rayleigh prior to fit the observations distributed in the image below. The current attempt was as a Gamma distribution, but as you can see this is a poor representation. Using Scipy's stats module, I fit a number of…
cmp
  • 568
  • 3
  • 16
0
votes
0 answers

r program bayes.glmm giving an error Error in prep_call_sampler(object)

I am running bayes.glmm r package but it is giving an error: data("sample", package = "bayes.glmm") pheno = data$pheno geno = data$geno cov = data$cov L <- t(chol(data$K)) mymodel = stan_models(model = "glm", auto_write = TRUE) y2 =…
0
votes
1 answer

'numpy.float64' object cannot be interpreted as an integer in Bayes optimization

I understand that when 'numpy.float64' object cannot be interpreted as an integer some variable is seen as decimal instead of integer. The problem is I can`t find which one, since the type of those I use is integer. The problem occurs when I try to…
Len
  • 43
  • 5
0
votes
0 answers

Can I use Student's T distribution in rainier?

I want to get started with the statistical framework Rainier. There's a list of pre-built distribution that does not include Student's T, which I need for my project. How can I use a custom distribution as a prior to my model?
mchl_k
  • 314
  • 1
  • 10
0
votes
1 answer

weighted correlation in python

I am trying to using the weighted correlation function from here def m(x, w): """Weighted Mean""" return np.sum(x * w) / np.sum(w) def cov(x, y, w): """Weighted Covariance""" return np.sum(w * (x - m(x, w)) * (y - m(y, w))) /…
deathracer
  • 305
  • 1
  • 20
0
votes
1 answer

How to plot the Curve fitting with Bayesian Ridge Regression using specific dataset columns

In order to plot the Bayesian regression I am following the method found at: "https://scikit-learn.org/stable/auto_examples/linear_model/plot_bayesian_ridge_curvefit.html" I cannot match my x,y plot axis data to my columns, then pass it to the def…
0
votes
1 answer

Running the Bayesian optimizer, and when the maximize function is executed, "one of the lower bounds is greater than an upper bound." Error occurs

We are running the Bayesian Optimizer for hyper parameter tuning. By the way, I get this error. The same error occurs even if you experiment with changing all of the parameter ranges. Please answer what should be done. def…
0
votes
1 answer

Bayes Factor as non-logistic output from proportionBF

I am estimating a BayesFactor of proportions using the comand proportionBF() from R. I want to replicate the example from wikipedia https://en.wikipedia.org/wiki/Bayes_factor. The output from the proportionBF comand is in log, so I transform the…
Ushuaia81
  • 495
  • 1
  • 6
  • 14
0
votes
1 answer

Splitting movielens data into train-validation-test datasets

I'm working on a project on recommender systems written by python using the Bayesian Personalized Ranking optimization. I am pretty confident my model learns the data I provided well enough, but now it's time I found out the exact model…
0
votes
1 answer

STAN IRT via R programming, issue with parameter declaration?

I'm following along with this official IRT w/ STAN tutorial. The details of the model are copied below: data { int J; // number of students int K; // number of questions int N; …
jbuddy_13
  • 902
  • 2
  • 12
  • 34
0
votes
1 answer

Problems adjusting Linear Regression at Stan

I'm having trouble adjusting a linear regression model on the stan. When observing the error message, the identification in the block part of the transformed parameters is noted. See below the structure of the code in…
user55546
  • 37
  • 1
  • 15
0
votes
0 answers

Why the bvar command provides this error?

I run the following bayesain var code but I've got an error x <- bvar(Data, lags = 1, n_draw = 1000L, n_burn = 200L, verbose = FALSE) Error in bvar(Data, lags = 1, n_draw = 1000L, n_burn = 200L, verbose = FALSE) : Problem with the data. Make sure…