similar to: R2WinBUGS problem

Displaying 20 results from an estimated 600 matches similar to: "R2WinBUGS problem"

2012 Oct 26
1
Openbugs- Array Index
Hi, I'm working on the codes below however every time I run them when they get to OpenBUGS I keep getting the error message: array index is greater than array upper bound for hab. Any help would be greatly appreciated, Suzie Codes: ungulate <- read.csv(file.choose ()) #ungulate ungulate <- as.matrix(ungulate);colnames(ungulate)<-NULL;rownames(ungulate)<-NULL
2009 Dec 03
2
Help R2WinBUGS
Hello, I have problem running WinBUGS from R. The following example works in WinBUGS but it does not work in R through package R2WinBUGS. Does anyone know what the problem is? x <- c(0.2, 1.1, 1, 2.2, 2.5, 2.9, 2.9, 3.6, 3.8, 0.6, 1, 2, 2.4, 2.6, 2.8, 3.2, 3.9, 3.5) y <- c(0.5, 1.3, 0.1, 0.7, -0.4, 0.5, -0.9, -0.3, -0.3, 0.6, 0.4, 0.9, -0.1, -0.4, -0.5, -0.2, 0.3, -1.5) eco <- c(1, 3,
2009 Jul 16
1
Error with r2winbugs
Hi, I am trying to do run the following model saved in "C:/bugs/sus.bug" model { for (i in 1:n){ y[i] ~ dpois(lamdba[i]) log(lambda[i]) <- mu+bmale[male[i]]+bschn[schn[i]]+epsilon[i] # epsilon[i] ~ dnorm(0,tau.epsilon) } mu ~ dnorm(0,.0001) bmale ~ dnorm(0,.0001) tau.epsilon <- pow(sigma.epsilon, -2) sigma.epsilon ~ dunif(0,100) for (j in
2012 May 23
1
how a latent state matrix is updated using package R2WinBUGS
I'm trying to understand how a latent state matrix is updated by the MCMC iterations in a WinBUGS model, using the package R2WinBUGS and an example from Kery and Schaub's (2012) book, "Bayesian Population Analysis Using WinBUGS". The example I'm using is 7.3.1. from a chapter on the Cormack-Jolly-Seber model. Some excerpted code is included at the end of this message;
2008 Dec 15
3
R2winbugs : vectorization
I'm new to bugs, so please bear with me. Can someone tell me if the following two models are doing the same thing? The reason I ask is that with the same data, the first (based on 4 separate coeffs a1--a4) takes about 50 secs, while the second (based on a vectorized form, a[]) takes about 300. The means are about the same, though R-hat's in the second version are quite a bit better.
2010 Oct 15
1
Problem using BRugs
Hi R users, I am trying to call openbugs from R. And I got the following error message: ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ model is syntactically correct expected the collection operator c error pos 8 (error on line 1) variable ww is not defined in model or in data set [1] "C:\\DOCUME~1\\maomao\\LOCALS~1\\Temp\\RtmpqJk9R3/inits1.txt"
2010 May 06
1
BRugs dwwinn.exe error
Hi, I have a strange behaviour of openBUGS and WinBUGS when I start them from R. Version: R: 2.10.1 openBUGS: 3.07 WinBUGS: 1.43 R2WinBUGS: 2.1-16 BRugs: 0.5-3 I have a model and data without initial start values. If I use the stand alone versions of openBUGS and WinBUGS I don't have any problems and I get what I want. If I use function bugs() from R2WinBUGS- resp. BRugs-Library then
2009 Aug 19
1
BUGS
I am running a BUGS function with following   schools.sim <-bugs(data,inits,                              parameters,                              model.file="schools.txt",                              n.chains=3,                              n.iter=1000,                              bugs.directory="E:/Rprograms")   My model.file IS in the directory
2006 Dec 09
1
WinBUGS14 and R
I'm trying to call BUGS from R. But it's not working. R freezes up and BUGS gives me a strange output in the log. Just to know, BUGS is registered. The modified date on the keys file is today (Dec. 9th). It should be fully registered so that I can use it fully. And, the BUGS model is syntactically correct. Any suggestions would be very helpful. Here is my BUGS model: model {
2006 Apr 27
1
State space AR models in R: some examples
Hi all, Does anyone have an example of an autoregressive (AR) time-series model specified as a state space model in R? That is, I want to go beyond the locally linear (constant) model, and fit the following Gaussian AR state process model: Xt = a + (1+b)*Xt-1 + epsilon ,where the model for the observation process is Yt = Xt + tau I have information of the tau's (observation variance)
2012 Nov 28
2
Error message R2Jags
Hi, I'm trying to generate a GLMM for Y following a negative binomial distribution. The first step I'm taking as a beginner in the use of R2Jags is to generate a GLM for Y following a Poisson distribution (I heard it's good in order to get used to the coding language), so here I am and here I face the first error message for which I can't find any mistake of spelling. Could you
2012 Jul 13
3
Help with R2 OpenBUGs
Hi, I'm currently working on the below codes however whenever I run it in openbugs it gives an error message saying: unknown type of logical function error pos 76. Any help would be appreciated. ## bugs code library(R2OpenBUGS) sink("C:/Users/CCF/Documents/Suzie Work/PTY Project/Waterhole Correction/ungulate.txt") cat(" model{ # hyperparameters # habitat effects for each
2011 Nov 07
2
Dunif and Punif
Hi, I am trying to use dunif and runif however, I have two problems: if I do dunif(1:10, min=1, max=10) I get 10 values, which summed give me 1.1111 I understand that the probability is computed as f(x) = 1 / (max-min) but in this case it looks wrong: I have 10 values, each one equiprobable, and the probability for each one should be 0.1 and not 0.11111 (which is, consistently with the
2012 Aug 30
0
storage mode error question (R2winBUGS)
Hi all, I've been trying to run a model using R2winBUGS, and recurrently I get the message: "Error in FUN(X[[3L]], ...) : invalid to change the storage mode of a factor" My model is the following: sink("GLMM_Poisson.txt") cat(" model{ mu~dnorm(0,0.01) beta1~dnorm(-1,1) for(j in 1:nsite){ alpha[j]~dnorm(mu.alpha,tau.alpha) } mu.alpha~dnorm(0,0.01)
2007 Jul 21
1
R2WinBUGS awkward to use
Hi All Does anyone know if I can avoid to use the write.model() function below? I dont want to do this. Can't bugs() do that automatically for me just by specifying the 4th argument 'model'? Just I like I am also using the 'inits' object! If I use 'model' in the same way as I use 'inits' I am getting the error: > sim <- bugs(data, inits, parameters,
2008 Feb 29
1
bugs.seed= and summary.only= option in R2WinBUGS
Dear R user: I am using R2WinBUGs to call WinBUGS from R. But I have some problems in using either the option bugs.seed and summary.only in the function bugs. Here are the programs and error messages. It appears that if I don't use either option, the program runs fine. I am using R2.5.1 and WinBUGs14. The program is not running: > schools.sim <- bugs(data, inits,
2010 Nov 15
2
Zero truncated Poisson distribution & R2WinBUGS
I am using a binomial mixture model to estimate abundance (N) and detection probability (p) using simulated count data: -Each site has a simulated abundance that follow a Poisson distribution with lambda = 5 -There are 200 simulated sampled sites -3 repeated counts at each site - only 50 percent of the animals are counted during each count (i.e, detection probability p =0.5, see codes) We removed
2005 Sep 22
1
R2WinBUGS: Data loading error
Hi R-Help! I am trying to use R2WinBUGS but I get the following error message in WinBUGS (and there must be something wrong with my R statement as I tried it directly in WinBUGS and it worked): display(log) check(C:/Documents and Settings/Daikon/Roche/pop_model.txt) model is syntactically correct data(C:/Documents and Settings/Daikon/Roche/data.txt) expected key word structure compile(7) ...(and
2008 Jan 04
2
R2WinBUGS sending variables as factors
Hello R and BUGS users, I am writing a heirarchical model in R to send to BUGS via R2WinBUGS and I am finding it difficult to get the model to run. I seem to be having two problems. 1) I can't seem to send variables classed as factors (Month), is there a way do this? 2) Checking the Log in WinBUGS I can see that the model is Syntactically correct, but Bugs is not able to recognise the the
2008 Jan 31
1
R2WinBUGS is broken
Dear R-users, I am trying to use the following code to reproduce results from Prof. Gelman's book, but have the listed error for R2WinBUGS version (the openbugs version is good). I am using R-2.6.1 on windows XP, and all the R packages are most current ones. schools.bug can be found at http://www.stat.columbia.edu/~gelman/bugsR/runningbugs.html . Can anyone help me to figure out what's