Skip to main content
7 votes

Naive SE vs Time Series SE: which statistics should I report after Bayesian estimation?

These are measures of the computational MCMC error for the estimation of the posterior expected value of a parameter. One way of interpreting them is by comparing this MCMC error with the Standard ...
Rufo's user avatar
  • 553
6 votes

Example where the posterior from Jags and Stan are really different and have real impacts on decisions using the model

Whenever I want to get started with understanding a new statistical topic, I start by reading articles about it. In this case, I'd start with Carpenter et al. "Stan: A Probabilistic Programming ...
Sycorax's user avatar
  • 92.6k
5 votes

Combining posterior distributions

Unfortunately, you cannot combine posterior chains in that way. From your description, what you have are independent draws from MCMC chains for the following posterior distributions: $$p(\beta|\...
Ben's user avatar
  • 130k
5 votes

Is it make sense to set the vague prior when your data size is small?

The use of vague or informative prior depends on the amount of knowledge that you have for the parameters that you want to assign the prior. I consider the following cases: No experts information and ...
Fiodor1234's user avatar
  • 2,286
4 votes

How to implement credible 95% interval for median odds ratio using JAGS?

I don't know if this is a solution for you, but since the lme4 glmer function can provide random intercept posterior median estimates and their conditional variance - and under the assumption of ...
Milan Seth's user avatar
4 votes
Accepted

"Mixed effect" ANOVA in R with JAGS/BUGS

In order to include a random effect (and potentially other fixed effects) you need to format your data in long (rather than wide) format, and use nested indexing with separate vectors as indicator ...
Matt Denwood's user avatar
  • 1,056
4 votes
Accepted

Mixture of Normal and Exponential distributions with unkown weights and parameters using JAGS

Your posteriors look suspiciously like your priors, which usually indicates that your model is not being fit to data. My best guess is that you have not correctly included the vector "Ones" with your ...
Matt Denwood's user avatar
  • 1,056
4 votes

How do I specify a Bayesian Beta binomial model, with predictor variables, for R2jags?

It is not really a "how to code it in JAGS" problem, but it is about defining the appropriate model for your data. If you want to include predictor variables for your data, this means you need a ...
Tim's user avatar
  • 140k
4 votes
Accepted

rjags mixture model for a combination of normal and gamma distributions

It is relatively easy to implement a mixture model where the different distributions have the same parametric family - the dnormmix distribution in JAGS does this using an inbuilt distribution for a ...
Matt Denwood's user avatar
  • 1,056
4 votes

R alternatives to JAGS/BUGS

Probably the most powerful Bayesian package presently available in R is the RStan package (which has a whole website here). ...
Ben's user avatar
  • 130k
4 votes

Estimating positive and negative predictive value without knowing the prevalence

I don't use RJags so I can't confirm your code but I would say 'yes' your idea makes sense with three caveats: First, (intuitively) your likelihood contains little-to-no information on the prevalence ...
psboonstra's user avatar
  • 2,200
4 votes

Example where the posterior from Jags and Stan are really different and have real impacts on decisions using the model

In a recent paper with Carlos Cinelli, "Causally sound priors for binary experiments," we demonstrate a simple 3-parameter model for which exact posterior sampling is possible and yet Stan ...
njirons's user avatar
  • 61
4 votes
Accepted

influence of bayesian priors: rjags and categorical variables

If you set as a prior for the ID coefficients a uniform distribution between -5 and 5, this means that these coefficients are assumed to be in the interval $[-5,5]$, other values are impossible. These ...
Christian Hennig's user avatar
3 votes

Fitting regression spline

It somewhat depends on what sort of a spline you want, but there is a Stan case study on splines here. The essence of your Stan program would be something like: ...
Ben Goodrich's user avatar
  • 2,008
3 votes

Bayesian approach systematically overestimates sigma (SD)

I haven't checked everything in your zip file, but the problem seemed to be simple enough based on the JAGS model you have posted. The discrepancy between sd and JAGS output is due to sensitivity to ...
psolymos's user avatar
3 votes

What is the distribution of the ratio of two normals?

What is the distribution of the ratio of two normals? A related question is A/B testing ratio of sums The following is from a part of an answer to that question. (You state that both variables are ...
Sextus Empiricus's user avatar
3 votes

Appropriate GLM when response variable is proportion, but not binomial

Before venturing into the territory of GLMs it might be worth fitting a regression model on an appropriately transformed version of the response variable. If we let $0<Y_i<1$ be the area-...
Ben's user avatar
  • 130k
3 votes
Accepted

Bayesian autoregressive model with second peak at 1 in posterior distirbution of AR parameter

The peak can be eliminated by using a different prior for $\mu$. The simplest way to implement the new prior is to change the parameterization. Currently, you have \begin{equation} y_{t+1} = (1-\rho)\,...
mef's user avatar
  • 3,236
3 votes
Accepted

DIC, WAIC in JAGS

There is more than 1 definition of DIC and WAIC. Celeux et al. (2006) provide 8 variants of DIC; Gelman and Vehtari (2013) provide 2 definitions of WAIC. Other definitions exist too. The first three ...
Earlien's user avatar
  • 758
3 votes
Accepted

Bayesian p-value in wrong direction using step function in JAGS / BUGS

The so-called 'Bayesian p-value' does not have the same interpretation as a true p-value: remember that you do not have a formal hypothesis test so there is no real concept of a 'probability of the ...
Matt Denwood's user avatar
  • 1,056
3 votes
Accepted

Comparing a Bayesian model with a Classical model for linear regression

Try: ...
Sergio's user avatar
  • 6,031
3 votes

Is it correct to use the posterior distribution from a Bayesian model in other analysis?

You could, but keep in mind that the errors would propagate, so each new model you stack adds to the uncertainty of the end result. But why would you do that? Your description lacks details, but it ...
Tim's user avatar
  • 140k
2 votes
Accepted

Jags Implementation of Multivariate Response Probit Model

Except if I'm mistaken the problem comes about by the fact that for JAGS Y_s has no initial values. By adding to your ...
Simon Hug's user avatar
2 votes

Bayesian variable selection -- does it really work?

If you used log returns, then you made a slightly biasing error but if you used future value divided by present value then your likelihood is wrong. Actually, your likelihood is wrong in either case. ...
Dave Harris's user avatar
  • 7,780
2 votes

rjags does not seem to use initial values specified

rjags uses inital value. Your theta merely have fallen from 150 to about 5 for only one iteration (from 0 to 1). The main causes are the model and eta's inital value. ...
cuttlefish44's user avatar
2 votes
Accepted

Winbugs beta distribution

Beta is a distribution bounded in $[0, 1]$, or $(0, 1)$, depending on it's definition. Notice however that since it is continuous, probability of seeing exact $0$ or $1$ is zero. Moreover, log-...
Tim's user avatar
  • 140k
2 votes
Accepted

Calculating the minimum value of a higest density interval from a posterior paramter estimate

The short answer is that these would (usually) be calculating different things - see the following graph which shows highest posterior density interval (using coda for convenience) in blue and a ...
Matt Denwood's user avatar
  • 1,056
2 votes
Accepted

Parameters not in the credible interval interpretation in Bayesian model

The OP's question about splines can be generalized as a question about model selection, or re-instantiated in multiple regression where it's called the question of variable selection. In multiple ...
John K. Kruschke's user avatar
2 votes

How do I deal with imperfect detection of a covariate in Bayesian Binomial Regression?

My answer is intended to suggest a way to think about the problem. You may be able to adapt my formulation to your specific problem and your specific software. Begin with a model with observed ...
mef's user avatar
  • 3,236
2 votes
Accepted

Convergence issue dirichlet model JAGS, implemented in R

From Martyn Plummer, posted on the JAGS discussion board: When you see this phenomenon - poor mixing but good predictions of observable quantities - it means your model is unidentifiable. This is a ...
colin's user avatar
  • 1,242

Only top scored, non community-wiki answers of a minimum length are eligible