Search Results
Search type | Search syntax |
---|---|
Tags | [tag] |
Exact | "words here" |
Author |
user:1234 user:me (yours) |
Score |
score:3 (3+) score:0 (none) |
Answers |
answers:3 (3+) answers:0 (none) isaccepted:yes hasaccepted:no inquestion:1234 |
Views | views:250 |
Code | code:"if (foo != bar)" |
Sections |
title:apples body:"apples oranges" |
URL | url:"*.example.com" |
Saves | in:saves |
Status |
closed:yes duplicate:no migrated:no wiki:no |
Types |
is:question is:answer |
Exclude |
-[tag] -apples |
For more details on advanced search visit our help page |
"JAGS is Just Another Gibbs Sampler. It is a program for analysis of Bayesian hierarchical models using Markov Chain Monte Carlo (MCMC) simulation not wholly unlike BUGS." (http://mcmc-jags.sourceforge.net/)
1
vote
1
answer
3k
views
Error in JAGS code [closed]
I'm trying to run the following code in JAGS
model {
for (i in 1:n){
z[i] ~ dnorm(X[i], tau)
X[i] <- D1*x1[i] + D2*x2[i] + D3*x3[i] + D4*x4[i]
}
denom <- 1 + sum(exp(p))
D1 <- (exp(p[1]))/denom …
1
vote
2
answers
4k
views
Compilation error in JAGS
0.6140674 ,0.6240171, 0.6150484, 0.4797000, 0.6211242, 0.5705000, 0.5709000, 0.6144000 ,0.6412593, 0.6611542, 0.6364444, 0.3599000, 0.6375195)
I'm trying to fit a lognormal random effects model in JAGS … Below my JAGS code:
# Lognormal Model
# N municipalities
# M years
# W Betas
model {
for(i in 1:N) {
for (j in 1:M) {
k <- (i-1)*8 + j
y[k] ~ dlnorm(mu[k], tau) …
1
vote
1
answer
4k
views
Code Problem in Lognormal Bayesian Model in JAGS/WinBUGS
0.000000
head(x)
gdp.cap bf.cap
1 8.789771 0.03911118
2 10.204732 0.02341257
3 6.890112 0.04160150
4 9.178957 0.03892352
5 9.384171 0.03880186
6 9.562188 0.04165802
I'm calling JAGS … from R to run the following code:
1) In JAGS
model {
# Lognormal likelihood
for(i in 1:N) {
y[i] ~ dlnorm(mu[i], tau)
mu[i] <- beta0 + inprod(x[i,], beta[])
}
# Prior …
0
votes
Compilation error in JAGS
JAGS does not accept to have an object receiving multiple values inside different loops. I changed the JAGS code and it worked. … See Below:
JAGS CODE:
model {
for(i in 1:N) {
for (j in 1:M) {
y[(i-1)*8+j] ~ dlnorm(mu[(i-1)*8+j], tau)
mu[(i-1)*8+j] <- beta0 + delta[i] + inprod(x[(i-1)*8+j,], …