I've been trying to reproduce the results of the following paper using R and JAGS with no success. I can get the model to run, but the results shown are consistently different.
Link for the paper:…
I am trying to run a model in JAGS but I got the following error:
Error in jags.model(model.file, data = data, inits = init.values, n.chains = n.chains, :
RUNTIME ERROR:
Cannot insert node into m[1]. Dimension mismatch
The model I specified…
The Problem
I have a small dataset (N=100). I need to run a Poisson regression, but excluding one observation at a time (hence, a Rolling Poisson Regression).
There are several predictors in the equation, but I care about one (call it b.x). My idea…
This is my first time using JAGS and I ran into some errors when modeling my data.
Here is a brief description of my data:
A total of n people (e.g., 2) each solved m problems (e.g., 6). All problems have 3 answers, each of a certain value V.
Here…
Hi everyone I'm new in JAGS and currently doing a bayesian inference using mcmc through RJAGS. I've been trying my best to debug my code until I'm stuck with this error "Error in node e1[3] Node inconsistent with parents".…
My data file looks something like this:
list(y=structure(.Data=c(26, 228, 31, ...)), .Dim=c(413,9))
Let's say this file is saved as "data.txt".
If I'm working in 'R2OpenBUGS', it allows me to pass the data as a file with no problem:
mcmc <-…
I'm new to JAGS and I'm running a model in R via R2jags package.
The model code is based on a code taken from Kéry & Schaub 2012 ('Bayesian Population Analysis using WinBUGS"), pg 399.
Chi-square discrepancy measure is computed
model {
....
for(g…
I am working through the textbook "Bayesian Ideas and Data Analysis" by Christensen et al.
There is a simple exercise in the book that involves cutting and pasting the following code to run in Winbugs:
model{ y ~ dbin(theta, n) # Model the data…
I'm trying to parameterise a gamma distribution in JAGS - with a piecewise linear predictor but my model fails to run with the following error message:
Error: Error in node (ashape/(aexp(mu[59]))) Invalid parent values
The model works when…
I am building a hierarchical bayesian model for shots in a football/soccer match. my code is below.
dat1 <- read.csv("1314prem.csv")
home <- 0.2 # for simplicity fixing home (can be modelled separately)
model2.string <-"
model {
for (i in 1:N){
#…
I'm using rjags to calculate a species abundance using an N-mixture model and count data. To capture over dispersion of my data, I used hyperpriors. But I get an
"Error in node S[1,1,2] Invalid parent values"
My guess is that I have a problem in…
I have implemented the LDA model with rjags. And I successfully got the final samples with:
jags <- jags.model('../lda_jags.bug',
data = data,
n.chains = 1,
n.adapt = 100)
update(jags, 2000)
samples <-…
I am working on an experiment design problem and trying to fit a JAGS model via R and r2jags.
To measure carryover effect, I must access the i-1 element in the list for one of the variables. When i=1, this variable must return the last item in its…
I used R dump() to create a data.txt file as specified by the latest JAGS manual, but I keep running into this error:
Reading data file data.txt
syntax error, unexpected LIST, expecting DOUBLE or NA or ASINTEGER or 'c'
The data.txt produced by…