8
votes
Accepted
What is causing autocorrelation in MCMC sampler?
When using Markov chain Monte Carlo (MCMC) algorithms in Bayesian analysis, often the goal is to sample from the posterior distribution. We resort to MCMC when other independent sampling techniques ...
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 ...
5
votes
Accepted
Multi-level Bayesian hierarchical regression using rjags
You want a distribution for
each quarter (given a state),
each state (given a region), and
each region.
That means you'll need at least some state parameters indexed by s (in your model b0, b1, ...
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 ...
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 ...
4
votes
Accepted
My MCMC do not overlap : Mixturemodel with JAGS and R
Imagine you have a mixture of two normal distributions, the one on the left (L) and the one on the right (R) side of the plot presented below. To estimate $\mu_L$ and $\mu_R$ parameters you decide to ...

Tim♦
- 136k
4
votes
Invalid parent values in JAGS
This is just a guess, but one of the distributions might be receiving invalid values.
For example you have the line:
...
4
votes
Accepted
Bayesian errors-in-variables model definition in JAGS and symbolically
JAGS model notation is almost exactly the same as would you describe this model mathematically:
$$
\alpha \sim \mathrm{Normal}(0, .001) \\
\beta \sim \mathrm{Normal}(0, .001) \\
\sigma_y \sim \...

Tim♦
- 136k
4
votes
Accepted
coding a JAGS error model for a dependent variable that has increasing variance as a function of the magnitude of the dependent variable
JAGS does not allow directed cycles (parameters being used to define themselves), so you can't use y to define the parents of y. That means that if y appears on the left hand of a distribution, then ...
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♦
- 136k
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 ...
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 ...
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 ...
4
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 ...
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 ...
3
votes
Accepted
reduce size of an MCMC/ rjags object
Three thoughts:
That many samples until convergence sounds like there are issues with your model/priors. The diagnosis would require seeing the model -- and also more knowledge than I have. Some ...
3
votes
Accepted
error when running JAGS
As your error message says
Error in node xtrue[1]
Invalid parent values
the xtrue variable has invalid parent values, so ...

Tim♦
- 136k
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-...
3
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|\...
3
votes
What prior distributions could/should be used for the variance in a hierarchical bayesisan model when the mean variance is of interest?
I disagree with the way you interpret Gelman concerning the choice of the Gamma for scale parameter. The basis of hierarchical modeling is to relate individual parameters to a common one through a ...
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 ...
3
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 ...
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)\,...
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 ...
3
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). ...
3
votes
Accepted
2
votes
MCMC converging to a single value?
This is more a comment, but as I do not have enough reputation I might as well answer.
From my limited experience with MCMC samplers, what I have observed is that the parameters tend to stay fixed ...
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. ...
2
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 ...
2
votes
Accepted
What is the distribution of the ratio of two normals?
You do not need to know the distribution of the dependent variable to design a useful regression model. One introduction to the assumptions of linear regression is available here. You need to ...
Only top scored, non community-wiki answers of a minimum length are eligible
Related Tags
jags × 301bayesian × 170
r × 105
markov-chain-montecarlo × 54
bugs × 54
hierarchical-bayesian × 40
stan × 26
prior × 18
winbugs × 17
regression × 15
multilevel-analysis × 15
mixed-model × 12
posterior × 10
distributions × 9
gibbs × 9
time-series × 7
logistic × 7
beta-distribution × 7
predictive-models × 6
zero-inflation × 6
generalized-linear-model × 5
modeling × 5
multinomial-distribution × 5
state-space-models × 5
dirichlet-distribution × 5