# Tag Info

### 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 ...
• 553

### 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 ...
• 92.6k

### 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|\...
• 130k

### 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 ...
• 2,286

### 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 ...
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 ...
• 1,056
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 ...
• 1,056

### 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 ...
• 140k
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 ...
• 1,056

### 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). ...
• 130k

### 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 ...
• 2,200

### 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 ...
• 61
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 ...
• 26.9k

### 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: ...
• 2,008

### 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 ...
• 41

### 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 ...
• 82.9k

### 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-...
• 130k
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 y_{t+1} = (1-\rho)\,...
• 3,236
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 ...
• 758
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 ...
• 1,056
Accepted

Try: ...
• 6,031

### 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 ...
• 140k
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 ...

### 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. ...
• 7,780

### 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. ...
• 590
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-...
• 140k
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 ...
• 1,056
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 ...
• 2,531

### 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 ...
• 3,236