similar to: WinBUGS with R

Displaying 20 results from an estimated 900 matches similar to: "WinBUGS with R"

2012 Oct 03
1
Errors when saving output from WinBUGS to R
Dear all I used R2WinBUGS package's bugs() function to generate MCMC results. Then I tried to save the simulation draws in R, using read.bugs() function. Here is a simple test: ###################### library(coda) library(R2WinBUGS) #fake some data to test beta0=1 beta1=1.5 beta2=-1 beta3=2 N=200 x1=rnorm(N, mean=0,sd=1) x2=rnorm(N, mean=0,sd=1) x3=rnorm(N, mean=0,sd=1) lambda2= exp(beta0+
2005 Nov 09
2
About: Error in FUN(X[[1]], ...) : symbol print-name too long
Hi, I??m trying to use the Win2BUGS package from R and I have a similar problem that reurns with the message: Error in FUN(X[[1]], ...) : symbol print-name too long But, there is no stray ` character in the file ( Sugestions given by: Duncan Temple Lang <duncan> Date: Mon, 26 Sep 2005 07:31:08 -0700 ) The progam in R is: library(R2WinBUGS) library(rbugs) dat <-
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 Jan 08
1
Error cannot allocate vector of size...
Hello, I have a memory problem when I run package WinBUGS with R (2.6.1). Until now I have been using a Pentium IV 3.2Ghz computer with 512Mb of RAM memory (with Windows XP Pro SP2), and I hadn't had any problem. Now I have a new computer with the following characteristics: Intel Core 2 duo 2.33Ghz and 3Gb of RAM memory (with Windows XP Pro SP2) and when I am running the same R syntax I
2010 Jun 23
1
A question about R2Winbugs
Dear R users: I was trying to fit a HMM with mixture of Gaussian into the dataset, and I tried to implement it by R2Winbugs. But I got the following errer. * Error in FUN(X[[1L]], ...) : .C(..): 'type' must be "real" for this format* Does anybody know what's the problem? Does R2Winbugs accept some matrix as inits? I would really appreciate your help. Thank you very much.
2012 Jul 09
1
R to winbugs interface
Hello everyone, I need some help regarding calling WinBUGS from R. I have a model for WinBUGS and an R code which calls WinBUGS. On running the code I am being shown the error message : Error in file(con, "wb") : cannot open the connection In addition: Warning messages: 1: In file.create(to[okay]) : cannot create file 'c:/Program
2012 Jul 02
1
How to get prediction for a variable in WinBUGS?
Dear all,I am a new user of WinBUGS and need your help. After running the following code, I got parameters of beta0 through beta4 (stats, density), but I don't know how to get the prediction of the last value of h, the variable I set to NA and want to model it using the following code.Does anyone can given me a hint? Any advice would be greatly appreciated.Best
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
2010 Apr 08
1
a small question about R with Winbugs
I try to do a test for dirichlet process for Multivariate normal, but Winbugs always says "expected multivariate node", does that mean I miss something at initialization? I will really appreciate the help to solve this problem Here is the R code, and Winbugs code. model { for(i in 1:N){ y[i,1:2] ~ dmnorm(mu[i,],tau[i,,]) S[i] ~ dcat(pi[]) mu[i,1:2] <- mu.star[S[i],]
2009 Jan 20
1
R and WinBUGS (via R2WinBUGS) error
Dear UseRs, Apologies, I tried to post to the list yeasterday, but (for some reason) part of my message got missed off. Here's a second attempt. I am having some problems using R with WinBUGS using the R2WinBUGS package. Specifically, when I try to run bugs() I get the following message. Error in FUN(X[[1L]], ...) : .C(..): 'type' must be "real" for this format To
2018 Jul 20
3
Should there be a confint.mlm ?
It seems that confint.default returns an empty data.frame for objects of class mlm. For example: ``` nobs <- 20 set.seed(1234) # some fake data datf <- data.frame(x1=rnorm(nobs),x2=runif(nobs),y1=rnorm(nobs),y2=rnorm(nobs)) fitm <- lm(cbind(y1,y2) ~ x1 + x2,data=datf) confint(fitm) # returns: 2.5 % 97.5 % ``` I have seen proposed workarounds on stackoverflow and elsewhere, but
2010 Jan 19
1
Help on using WinBUGS on Mac
Dear all, I had trouble in setting up WinBUGS on my Mac, and I'm seeking for some help here. I followed the instruction by Tom Palmer here: http://www.ruudwetzels.com/MacBUGS/winbugsonmacosx.pdf I installed Darwine 1.1.21, and downloaded WinBUGS14. However, when I double-clicked the WinBUGS14.exe file, a black-box dialog window poped up, and I got error message in the Wine log as
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
2010 Nov 12
1
Problem retrieving data from R2InBUGS
Dear list I am calling the functiton bugs() provided by R2WinBugs to performs an IRT analysis. The function returns a set of estimated parameters over n replications/iterations. For each replication, two sets of person measures (theta1 and theta2) and two sets of item difficulty parameters (diff1 and diff2) are returned. The code used to obtain these estimates is as follows: sim <-
2009 Dec 16
1
WinBUGS - R2WinBUGS problem
Appologies for cross-posting Dear R users, I am using R2WinBUGS to call WinBUGS from R. After loading data, model, and initial values I call this command res <- bugs(data = dfile, inits = list(ifile), parameters.to.save = c("beta"), model.file = mfile, working.directory = tdir, n.thin = nthin, n.chains = 1, n.iter = niterations*nthin, n.burnin = 0, DIC = F, debug = T,
2006 Oct 09
1
winbugs - R question
hi all i would like to use r and winbugs in order to undertake seemingly unrelated regression. i am using the R2WINBUGS library. i just simulated a simple example (sample size is 25) in order to get the correct code. i suspect that the problem is in my definition of the prior. it wants a multivariate node. the example could be extended by including more than 1 X variable in the system of
2005 Dec 01
2
Minimizing a Function with three Parameters
Hi, I'm trying to get maximum likelihood estimates of \alpha, \beta_0 and \beta_1, this can be achieved by solving the following three equations: n / \alpha + \sum\limits_{i=1}^{n} ln(\psihat(i)) - \sum\limits_{i=1}^{n} ( ln(x_i + \psihat(i)) ) = 0 \alpha \sum\limits_{i=1}^{n} 1/(psihat(i)) - (\alpha+1) \sum\limits_{i=1}^{n} ( 1 / (x_i + \psihat(i)) ) = 0 \alpha \sum\limits_{i=1}^{n} (
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 Jun 06
1
error calling Winbugs using R2WinBugs to run a multi-level model
Dear all, I'm calling Winbugs (1.4.3) through R2WinBugs (2.1-18 coda_0.14-7) to fit a switching random walk model, but come up with an instant trap with the log only displaying 'check('. I will paste the trap with session info below; I'd be very grateful for any ideas. Couple of leads: 1. I presume the problem relates to the r package itself or the way I call bugs(), because I
2012 Aug 07
6
Decimal number
HI >i have a little problem please help me to solve it >this is the code in R: >> beta0 [1] 64.90614 > beta1 [1] 17.7025 > beta [1] 17 64 >her beta<- c(beta0, beta1) thank you in advance hafida -- View this message in context: http://r.789695.n4.nabble.com/Decimal-number-tp4639428.html Sent from the R help mailing list archive at Nabble.com.