Hi everyone, I am trying to convert a JAGS example from R into Python using
rpy2. The example code is here:

http://dl.dropbox.com/u/1570604/radon-example.zip

I get this error:

rpy2.rinterface.RRuntimeError: Error in jags.model(model.file, data = data,
inits = inits, n.chains = n.chains,  : 
  RUNTIME ERROR:
Compilation error on line 3.
Unable to resolve parameter y.hat[1] (one of its ancestors may be undefined)

I have all necessary variables, and I pass them to rpy / R using R.r.assign. 

The problem cannot be with the radon.3.bug file because I use the same file from
R code, and it works fine. 

R.r.assign('n',n)
R.r.assign('J',J)
R.r.assign('y',y)
R.r.assign('county',county)
R.r.assign('x',x)
R.r.assign('u',u)

R.r('radon.data <- list ("n", "J", "y", "county", "x", "u")')
R.r('''
radon.inits <- function (){
  list (a=rnorm(J), b=rnorm(1), g.0=rnorm(1), g.1=rnorm(1),
        sigma.y=runif(1), sigma.a=runif(1))}
''')
R.r('radon.parameters <- c ("a", "b", "sigma.y", "sigma.a")')

R.r('radon.3 <- jags(radon.data, radon.inits, radon.parameters, "radon.3.bug",
n.chains=3, n.iter=500)')


Any ideas? 



------------------------------------------------------------------------------
Nokia and AT&T present the 2010 Calling All Innovators-North America contest
Create new apps & games for the Nokia N8 for consumers in  U.S. and Canada
$10 million total in prizes - $4M cash, 500 devices, nearly $6M in marketing
Develop with Nokia Qt SDK, Web Runtime, or Java and Publish to Ovi Store 
http://p.sf.net/sfu/nokia-dev2dev
_______________________________________________
rpy-list mailing list
rpy-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rpy-list

Reply via email to