similar to: R2winbugs : vectorization

Displaying 20 results from an estimated 400 matches similar to: "R2winbugs : vectorization"

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"
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
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
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 {
2012 Dec 04
1
Winbugs from R
Hi, I am trying to covert a Winbugs code into R code. Here is the winbugs code model{# model’s likelihoodfor (i in 1:n){time[i] ~ dnorm( mu[i], tau ) # stochastic componenent# link and linear predictormu[i] <- beta0 + beta1 * cases[i] + beta2 * distance[i]}# prior distributionstau ~ dgamma( 0.01, 0.01 )beta0 ~ dnorm( 0.0, 1.0E-4)beta1 ~ dnorm( 0.0, 1.0E-4)beta2 ~ dnorm( 0.0, 1.0E-4)#
2008 Jul 23
1
R2WinBUGS problem
Dear friends - I'm on winXP, R 2.71 - I have with some help dveloped this multivariate normal model, which gives very plausible results in WinBUGS even without any initial values specified. However, when I then try to run the same model via the bugs function in R2WinBUGS with inits specified as inits=NULL the program stops in a dead end. So I have tried to make inits for the bugs function
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
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 17
3
printing a dataframe summary to disk
I'd like to write the summary of a dataframe to disk, so that it looks essentially the same as what you'd see on screen; but I can't seem to do it. Can someone tell me how? Thanks! ------------------------ Philip A. Viton City Planning, Ohio State University 275 West Woodruff Avenue, Columbus OH 43210 viton.1 at osu.edu
2010 Apr 19
1
BRugs
Hi. I am new here, and I am writing this Winbugs code with BRugs. n=length(bi.bmi) Lagegp=13 Lgen=2 Lrace=5 Lstra=15 Lpsu=2 #model gen x race bi.bmi.model=function(){ # likelihood for (i in 1:n){ bi.bmi[i]~ dbern(p[i]) logit(p[i])<- a0 + a1[agegp[i]]+a2[gen[i]]+a3[race[i]] + a12[agegp[i], gen[i]] + gam[stra[i]]+ u[psu[i],stra[i]] } # constraints for a1, a2, a3, a12 a1[1]<-0.0
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 Aug 15
1
Filling in a uniform dist plot
Hi all, Apologies in advance if this is really too simple, but I have given a good shot at this. I'm generating a standard uniform distibution y <- dunif(x) plot(x,y,type="l") This will draw a horizontal line at y = 1. I want to fill the area from x=(0,1) with a color. I've tried the polygon command to create a polygon of the same shape, but can't seem to set the
2009 Oct 04
1
convenience question
On: R 2.8.1 / Ms Windows / R-Gui-R-console I have a long-ish function, and to re-assure myself that it's actually making progress I've arranged a set of messages to the console (using cat). But what happens is that the messages don't actually display until the function has finished, which sort of negates the purpose. However, if I hit Return after starting the function, then all
2008 Aug 21
1
pnmath compilation failure; dylib issue?
(1) ...need to speed up a monte-carlo sampling...any suggestions about how I can get R to use all 8 cores of a mac pro would be most useful and very appreciated... (2) spent the last few hours trying to get pnmath to compile under os- x 10.5.4... using gcc version 4.2.1 (Apple Inc. build 5553) as downloaded from CRAN, xcode 3.0... ...xcode 3.1 installed over top of above after
2010 Jun 09
1
makign help files by hand
Can someone tell me how to make up (eg) a library's html help files by hand? I think I ought to be able to use RCMD Rdconv for this but (R-2.10.0, MS-win) when I type (in a dos session) "rdcmd rdconv --help" I get a message to the effect that a perl script rdconv can't be opened. Can I do this from within R itself? And if so, how (in particular, what is the target file to
2011 May 07
1
spdep::poly2nb problem
I downloaded a US states+territories shapefile from http://www.weather.gov/geodata/catalog/national/html/us-state.htm and unzipped it into my working directory. Then in R (version 12.2.0 for ms-win32): library(rgdal) # Version: 0.6-28 library(spdep) # Version: 0.5-24 (loads sp: Version: 0.9-72) # read in the data states<-readOGR(".","s_01de10") summary(states) # now
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 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
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,
2013 Mar 28
3
problem with plots with short example.
i am having problem running my own data. yesterday it was working just fine. today it is not. this is the code i was using as an example to follow. this code ALSO worked just fine yesterday, and is no longer working at all. i suspect it is a problem with either my computer or the software, at this point. if THIS won't even run.... something is wrong. i can assure you this isn't