search for: r2openbugs

Displaying 9 results from an estimated 9 matches for "r2openbugs".

Did you mean: openbugs
2011 Oct 20
1
Are they fully identical: WinBUGS and OpenBUGS; R2WinBUGS and R2OpenBUGS
Hello ALL! I am running Linux, Fedora 15 64-bits, and R on it. I need to use WinBUGS and R2WinBUGS, but as far as I read, WinBUGS is closed project, to be continued with/as OpenBUGS. Thus, I have found R2OpenBUGS on OpenBUGS Contributed Code (http://openbugs.info/w/UserContributedCode), not on CRAN. Author(s) states that it is equivalent for R2WinBUGS. I tried briefly, and realized few minor differences. However, it seems to work. I wonder if anyone checked thoroughly equivalence of WinBUGS and OpenBUGS, an...
2012 Jul 13
3
R2OpenBUGS quesion
Dear All: Could anybody help me figure out why I get the Error message below while I running the example code of bugs() function in R2OpenBUGS packages? I have tried the code both in Win 7 and Ubuntu 12.04, but they show the same message. My R version is 2.15.1 in win7 and 2.15.0 in Ubuntu. Many thanks ! Best, Yilong > schools.sim <- bugs(data, inits, parameters, model.file,+ n.chains=3, n.iter=5000)Error in...
2013 Jan 03
1
R2OpenBUGS question with differential equations
...uot;green") lines(x,cal,col="red")   as you can see, the parameter optimization using this code is done via a non-linear approach using the Nelder-Mead optimization. I was wondering if you could give me some ideas on how to rewrite this code so that it could be run using OpenBUGS via R2OpenBUGS? The issue I am hung up on is how to write the differential equation into a code that could run through R2OpenBUGS and OpenBUGS. Below is an example for an analytical solution for a different model I currently use that is run through R2OpenBUGS and OpenBUGS that generates excelent results (to be ab...
2013 Jan 06
0
How to use predict function from R2OpenBUGS results
Dear All,   I made some headways on my ODE problem in R2OpenBUGS, but got stuck again. Wonder if someone could help on the following:   I am running the following code:   library(R2OpenBUGS) dosetotal <-c(500,250) z <-c(4,2) grid <-c(4,15) n.grid <-2 tol <-0.001 dim <-2 T <-2 origin <-0 dosetime <-c("1/05/2013 0:00","1/0...
2013 Feb 18
1
compare posterior samples from R2OpenBugs and R function bugs{R2WinBUGS}
Hi all, I used both OpenBugs and R function bugs{R2WinBUGS} to run a linear mixed effects model based on the same data set and initial values. I got the same summary statistics but different posterior samples. However, if I order these two sets of samples, one is generated from OpenBugs and the other is generated from R, they turn to be the same. And the samples from R do not have any
2011 Jun 27
0
OpenBUGS and glmmBUGS package
...quot;]]) library(glmmBUGS) forBugs = glmmBUGS(formula=observed + logExpected ~ 1, effects="CSDUID", family="poisson", spatial=popDataAdjMat, data=ontario at data, modelFile="model.txt") startingValues = forBugs$startingValues source("getInits.R") library(R2OpenBUGS) ontarioResult = bugs(forBugs$ragged, getInits, parameters.to.save = names(getInits()), model.file="model.txt", n.chain=3, n.iter=100, n.burnin=10, n.thin=2) ------------------------------------------- I got error message saying "Error in bugs.run(n.burnin, OpenBUGS.pgm, debug = de...
2012 Oct 26
1
Openbugs- Array Index
...collected species in our case Y <- array(NA,dim=c(S,4,5)) for(i in 1:S){ Y[i,,] <- matrix(ungulate[i,],nrow=4,ncol=5,byrow=TRUE) } AY <- array(NA,dim=c((S+m),4,5))# Y of augmented for(i in 1:4){ y <- matrix(0,nrow=m,ncol=5) AY[,i,] <- rbind(Y[,i,],y) } ## bugs code library(R2OpenBUGS) sink("ungulate.txt") cat(" model{ # hyperparameters # habitat effects for each functional group for(i in 1:g){ # number of functional group for(j in 1:2){ # number of habitat type mu.h[i,j] ~ dnorm(0,0.0001) I(-2,2...
2012 Feb 01
1
problem working directory WinBUGS using R
Hi, I am trying to use WinBUGS using R, but i am having some problems using bugs function: out <- bugs(data = win.data, inits = inits, parameters.to.save = params, model.file = "model.txt", n.thin = nt, n.chains = nc, n.burnin = nb, n.iter = ni, debug = TRUE, DIC = TRUE, working.directory = getwd()) ls() WinBUGS file is in working directory=D:/Line/documents but R looks for
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 functional group g <- length(table(G)) for(i in 1:g){ # number of functional group for(j in 1:3){ # number of habitat type mu.h[i,j]...