JAGSrun | R Documentation |
Calls jags for MCMC sampling.
JAGSrun(y, prefix = yname, model = BMMmodel(k = 2),
control = JAGScontrol(variables = c("mu", "tau", "eta")),
tmp = TRUE, cleanup = TRUE, ...)
y |
a numeric vector. |
prefix |
character: prefix for .bug-file. |
model |
object of class |
control |
specification of control by a |
tmp |
logical: shall the files be written in a temporary directory. |
cleanup |
logical: shall the created files be removed. |
yname |
a character string with the actual |
... |
further parameters handed over to |
This function is a wrapper calling JAGScall
.
Returns a JAGSrun
object with components
call |
the matched call. |
results |
MCMC results obtained by calling functionality from package rjags. |
model |
a |
variables |
vector containing the names of the monitored variables. |
data |
a numeric vector. |
Bettina Gruen
JAGScall
,
BMMmodel
, initsFS
data("fish", package = "bayesmix")
prefix <- "fish"
variables <- c("mu","tau","eta")
k <- 3
modelFish <- BMMmodel(k = k, priors = list(kind = "independence",
parameter = "priorsFish", hierarchical = "tau"))
controlFish <- JAGScontrol(variables = c(variables, "S"), n.iter = 100)
z1 <- JAGSrun(fish, prefix, model = modelFish, initialValues = list(S0 = 2),
control = controlFish, cleanup = TRUE, tmp = FALSE)
zSort <- Sort(z1, "mu")
BMMposteriori(zSort)
data("darwin", package = "bayesmix")
prefix <- "darwin"
k <- 2
modelDarwin <- BMMmodel(k = k, priors = list(kind = "independence",
parameter = "priorsUncertain"),
aprioriWeights = c(1, 15),
no.empty.classes = TRUE, restrict = "tau")
z2 <- JAGSrun(darwin, prefix, model = modelDarwin, control =
JAGScontrol(variables = variables, n.iter = 3000,
burn.in = 1000), cleanup = TRUE, tmp = FALSE)
plot(z2, variables = "mu")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.