Description Usage Arguments Details Examples
Profile a DMC model based a model data instance (ie fitted
). For
the parameter p.name
, e.g., the boundary separation a in a DDM,
extract it our from a p.vector
and draws the profile likelihood for
data and returns the maximum (on a grid of resolution n.point
)
1 2 3 |
fitted |
a DMC model data instance |
p.name |
indicate which paramter in theta to plot. For example, in a
LBA model with a |
min.p |
minimal number of points to plot |
max.p |
maximal number of points to plot |
p.vector |
a parameter vector. Use Lognromal LBA model as an example,
|
n.point |
grid resolution |
digits |
print out how many digits |
... |
other graphical parameters (see par) |
Set a range for the x axis, which is the profiled parameter. Initiate a log-likelihodd vector with 0 everywhere and length n.point. keep the other parmaters value fixed and change only the target parameter value to ps[i], and then calculate its sum of log-likelihood. Finally, store it in the i position of ll vector. This function currently works for DDM density only.
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 | m1 <- model.dmc(
p.map=list(a="1",v="1",z="1",d="1",sz="1",sv="1", t0="1",st0="1"),
constants=c(st0=0,d=0),
match.map=list(M=list(s1="r1",s2="r2")),
factors=list(S=c("s1","s2")),
responses=c("r1","r2"),
type="rd")
p.prior <- prior.p.dmc(
dists = rep("tnorm", 6),
p1=c(a=2, v=2.5, z=0.5, sz=0.3, sv=1, t0=0.3),
p2=c(a=0.5, v=.5, z=0.1, sz=0.1, sv=.3, t0=0.05),
lower=c(0,-5, 0, 0, 0, 0),
upper=c(5, 7, 2, 2, 2, 2))
pVec <- c(a=1,v=1, z=0.5, sz=0.25, sv=0.2,t0=.15)
dat1 <- simulate(m1, nsim=1e2, p.vector=pVec)
mdi1 <- data.model.dmc(dat1, m1)
## ---------------------------
par(mfrow=c(2,3));
profile(mdi1, "a", .1, 2, pVec)
profile(mdi1, "v", .1, 2, pVec)
profile(mdi1, "z", .2, .8, pVec)
profile(mdi1, "sz", .1, .9, pVec)
profile(mdi1, "sv", .1, 2, pVec)
profile(mdi1, "t0", .01, .5, pVec)
par(mfrow=c(1,1));
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.