#--------------------------------------------------------- # making the model of simpleMC.R a bit more complicate... # # GdA 23/2/2015 #--------------------------------------------------------- library(rjags) #------------ model ---------------------------- model = "temp_model.bug" write(" model { m ~ dnorm(3, 1/4^2) x ~ dnorm(m, 1/5^2) y <- 2*x+10 z <- x^2 } ", model) jm <- jags.model(model, n.chains = 3) # define the model chain <- coda.samples(jm, c("m", "x","y","z"), n.iter=10000) # sampling print(summary(chain)) plot(chain)