simpleMPT {TreeBUGS} | R Documentation |
C++ Sampler for Standard (Nonhierarchical) MPT Models
Description
Fast Gibbs sampler in C++ that is tailored to the standard fixed-effects MPT model (i.e., fixed-effects, non-hierarchical MPT). Assumes independent parameters per person if a matrix of frequencies per person is supplied.
Usage
simpleMPT(
eqnfile,
data,
restrictions,
n.iter = 2000,
n.burnin = 500,
n.thin = 3,
n.chains = 3,
ppp = 0,
alpha = 1,
beta = 1,
parEstFile,
posteriorFile,
cores = 1
)
Arguments
eqnfile |
The (relative or full) path to the file that specifies the MPT
model (standard .eqn syntax). Note that category labels must start with a
letter (different to multiTree) and match the column names of |
data |
The (relative or full) path to the .csv file with the data (comma separated; category labels in first row). Alternatively: a data frame or matrix (rows=individuals, columns = individual category frequencies, category labels as column names) |
restrictions |
Specifies which parameters should be (a) constant (e.g.,
|
n.iter |
Number of iterations per chain (including burnin samples). See
|
n.burnin |
Number of samples for burnin (samples will not be stored and removed from n.iter) |
n.thin |
Thinning rate. |
n.chains |
number of MCMC chains (sampled in parallel). |
ppp |
number of samples to compute posterior predictive p-value (see
|
alpha |
first shape parameter(s) for the beta prior-distribution of the
MPT parameters |
beta |
second shape parameter(s) |
parEstFile |
Name of the file to with the estimates should be stored (e.g., "parEstFile.txt") |
posteriorFile |
path to RData-file where to save the model including
MCMC posterior samples (an object named |
cores |
number of CPUs to be used |
Details
Beta distributions with fixed shape parameters \alpha
and
\beta
are used. The default \alpha=1
and \beta=1
assumes
uniform priors for all MPT parameters.
Author(s)
Daniel Heck
Examples
## Not run:
# fit nonhierarchical MPT model for aggregated data (see ?arnold2013):
EQNfile <- system.file("MPTmodels/2htsm.eqn", package = "TreeBUGS")
d.encoding <- subset(arnold2013, group == "encoding", select = -(1:4))
fit <- simpleMPT(EQNfile, colSums(d.encoding),
restrictions = list("D1=D2=D3", "d1=d2", "a=g")
)
# convergence
plot(fit)
summary(fit)
## End(Not run)