Description Usage Arguments See Also Examples
Call coda package to summarise the model parameters in a DMC samples with multiple participants
1 2 |
object |
a model samples |
digits |
how many digits to print |
start |
summarise from which MCMC iteration. Default uses the first iteration. |
end |
summarise to the end of MCMC iteration. For example, set
|
... |
other aruguments |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 | m1 <- model.dmc(
p.map = list(a="1",v="F",z="1",d="1",sz="1",sv="1",t0="1",
st0="1"),
match.map = list(M=list(s1="r1",s2="r2")),
factors = list(S=c("s1","s2"),F=c("f1","f2")),
constants = c(st0=0,d=0),
responses = c("r1","r2"),
type = "rd")
pop.mean <- c(a=1.15, v.f1=1.25, v.f2=1.85, z=0.55, sz=0.15, sv=0.32,
t0=0.25)
pop.scale <- c(a=0.10, v.f1=.8, v.f2=.5, z=0.1, sz=0.05, sv=0.05,
t0=0.05)
pop.prior <- prior.p.dmc(
dists = rep("tnorm", length(pop.mean)),
p1 = pop.mean,
p2 = pop.scale,
lower = c(0,-5, -5, 0, 0, 0, 0),
upper = c(5, 7, 7, 1, 0.5, 2, 2))
dat <- h.simulate.dmc(m1, nsim=30, ns=4, p.prior=pop.prior)
mdi1 <- data.model.dmc(dat, m1)
ps <- attr(dat, "parameters")
p.prior <- prior.p.dmc(
dists= rep("tnorm", length(pop.mean)),
p1=pop.mean,
p2=pop.scale*5,
lower=c(0,-5, -5, 0, 0, 0, 0),
upper=c(5, 7, 7, 2, 2, 2, 2))
samples0 <- h.samples.dmc(nmc=30, p.prior=p.prior, data=mdi1, thin=1)
samples0 <- h.run.dmc(samples0)
class(samples0)
## [1] "dmc.list"
gelman.diag.dmc(samples0)
## summary calls theta.as.mcmc.list, which is very slow.
## summary(samples0)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.