Questions tagged [r2winbugs]

R2WinBUGS is an R package that interfaces with the WinBUGS and OpenBUGS Gibbs samplers.

Documentation and Download

78 questions
1
vote
1 answer

Made use of undefined node - WinBUGS beginner

I'm attempting to run a model using a large data set (5.9million rows). I get the error made use of undefined node ... I've tried lots of sample data (from my larger data set) which go through the model fine, until the sample data set size reaches…
Thomas C
  • 31
  • 7
1
vote
0 answers

Array index is not an integer error in OpenBUGS

I am trying to run a Markov model in OpenBUGS to estimate the transitional probabilities. But I am geeting an error "Array index is not an integer" Here is my model code: model{ p[1,1] ~ dnorm(0,1) p[2,2] ~ dnorm(0,1) p[3,3] ~ dnorm(0,1) p[1,2] ~…
Ecology
  • 55
  • 5
1
vote
0 answers

OpenBugs error: expected the collection operator c error pos 7515

I am trying to evaluate hierarchical models from R using the R2OpenBUGS library. I've already looked at the answers to similar questions, but nothing seemed to work. I'd be very pleased if someone could help. The model is the following. model{ for…
1
vote
1 answer

WinBUGS error 'expected key word END' caused by wrong exponential code (not length of data)

Q: Can anyone tell me the maximum number of data rows in a WinBUGS data file? How I found out there is a maximum. While building and testing a WinBUGS model in R2WinBUGS, I constructed a dummy data set with all possible data combinations of 6…
HvL
  • 29
  • 1
  • 6
1
vote
0 answers

gen.inits error for non-linear hierarchical model using R2winBUGS

I am relatively new to Bayesian statistics and am trying to apply a non-linear hierarchical model using R2winBUGS on some tree stocking density data. I am hoping someone may be able to help me find the reason why R2winBUGS is giving me the following…
1
vote
0 answers

Estimation Skate composition

I am trying to adjust a bayesian hierarchical model model { for (i in 1:n){ y[i] ~ dpois (lambda[i]) lambda[i] <- exp(mu+b.species[Species_A[i]] + epsilon[i]) epsilon[i] ~ dnorm (0, tau.epsilon) } mu ~ dnorm (0, .0001) mu.adj…
Ivone
  • 21
  • 2
1
vote
0 answers

Using the dpois command in WinBUGS as compared to R

I am trying to understand how the dpois command in WinBUGS differs from the dpois command in R. I am attempting to predict estimates for counts within different areas. The code works in WinBUGS and results in a count estimation, however for some of…
user72603
  • 11
  • 2
1
vote
0 answers

Winbugs "Undefined Real Results"

I am using R2 Winbugs to run an open-population binomial mixture model following Kery et al 2009 (paper here) with real data on surveys. As I first try I am using only one covariate for the abundance (X1) that I made up myself. The model compiles…
YMC
  • 63
  • 6
1
vote
0 answers

R2WinBUGS error message: status 28462

I am trying to run WinBUGS from R, using an example from an introductory text. Actually, I am using the same example and having a very similar problem to this guy: R2WinBUGS - Warning messages but I am getting a different error message and the…
Chris Rowe
  • 11
  • 1
1
vote
1 answer

How can I convert OpenBUGS Coda file to mcmc object in R?

I used OpenBUGS and it produced coda files of MCMC output. To calculate and plot Gelman Rubin and Geweke diagnostics, I need to convert this coda.odc file to a mcmc object in R? Is there any way to do this? Or do you recommend me some other way(s)…
Sedat
  • 25
  • 7
1
vote
1 answer

Undefined variable in BUGS with missing values

I'm running a BUGS model through R and I'm having a problem with BUGS saying one of my data sets is an 'undefined variable'. The data set it is having problems with has quite a few NA's in it, but why is this causing problems? It works just fine…
1
vote
1 answer

WINBUGS - error in code

I am trying to learn WINBUGS, and tried to build a small model, adjusted from an example in a text book, (code per below) that assumes a hidden population of infected carriers, with both a growth rate ("R0") and a removal rate (screening and…
user1885116
  • 1,757
  • 4
  • 26
  • 39
1
vote
0 answers

How to specify how much of the prior in t-1 goes onto the prior for t

I want to be able to specify how much of the "alpha" in t-1 goes onto the prior for t. I tried alpha[t,1:k] <- theta[t-1,1:k]*alpha0*n[t-1]; alpha0<-.5, but it didn't work. model { for(t in 1:T){ alpha[t,1:k] ~ ddirch(theta[1:k]) #alpha[t,1:k]…
user45367
  • 151
  • 1
  • 3
  • 14
1
vote
1 answer

OpenBUGS error "expected multivariate node"

I am writing a program in R which uses R2OpenBUGS. The code is given at the bottom. The following error is coming while running it- model is syntactically correct data loaded expected multivariate node model must have been compiled but not updated…
Dey
  • 119
  • 2
  • 13
1
vote
3 answers

Logit regression with WinBUGS/R2WinBUGS not converging to likelihood estimates

I am a Win-7 user with R 2.15.2 Can someone help me why is the following model not converging well close to simple logit model estimates? Edited Mydata <- structure(list(gg = c(13.659955, 6.621436486, 3.017166776, 2.516795069, 3.928538296,…
Stat-R
  • 5,040
  • 8
  • 42
  • 68