Description Usage Arguments Details Value Author(s) References See Also Examples
View source: R/prepare.mpt.fia.R
This function needs data and a model files and outputs the exact command needed to obtain the minimum description length measure for MPT models using the procedure by Wu, Myung, and Batchelder (2010) for MATLAB. It can be considered an extended wrapper for make.mpt.cf
.
1 2  prepare.mpt.fia(data, model.filename, restrictions.filename = NULL,
outfile = "clipboard", Sample = 2e+05, model.type = c("easy", "eqn", "eqn2"))

data 
Either a numeric 
model.filename 
A character 
restrictions.filename 

outfile 
A character vector specifying the name of the file where the MATLAB code is saved. Default is 
Sample 
Number of Monte Carlo samples to be used by the procedure of Wu, Myung, and Batchelder (2010). Default is 200.000. 
model.type 
Character vector specifying whether the model file is formatted in the 
This function uses make.mpt.cf
to create the representation in the LBMPT. Therefore, it is necessary that the representation of the model via equations in the model file exactly maps on the structure of the binary tree (see make.mpt.cf
for more details).
Whereas fit.mpt
can reparameterize MPT models for fitting inequality constraints, Wu, Myung, and Batchelder (2010) have used another method to deal with these issues that is also adopted here. Our function does not report a reparameterized version of the MPT model that satisfies the inequality contraints, but modifies the appropriate argument in the call to the function by Wu et al (2010).
Note that MATLAB needs the statistics toolbox to run the script by Wu, Myung, and Batchelder (2010).
The most important value is the output to a file or clipboard (Windows only) of the MATLAB code to get the minimum description length. For multiple individuals multiple outputs are generated which only differ if the ns of the data differ. Furthermore, each argument is returned in a list:
s 
The string representation of the model. 
parameters 
A list of the numbers representing the parameters. 
param.codes 
A vector describing which number corresponds to which parameter in the parameters vector. 
category 
The numbers representing the categories. 
ineq 
The matrix representing the inequality constraints. 
n 
The n of the data. 
internal 
The LBMPT representation as returned by 
Henrik Singmann
Wu, H., Myung, J., I., & Batchelder, William, H. (2010). Minimum description length model selection of multinomial processing tree models. Psychonomic Bulletin & Review, 17, 275286.
Since we ported the original BMPTFIA function by Wu, Myung, & Batchelder (2010) to R (bmpt.fia
), this function is a little bit outdated. However, getting the FIA in Matlab is (still) faster than getting it in R.
See also get.mpt.fia
which takes the same arguments but will then compute the FIA using the function provided by Wu et al. (2010) ported to R.
1 2 3 4 5 6 7 8 9 10 11  ## Not run:
# This example produces the code for the first example of how to use the
# function by Wu, Myung & Batchelder (2010, pp. 280):
# Value should be around 12.61 and 12.62
model.1htm < system.file("extdata", "wmb.ex1.model", package = "MPTinR")
model.1htm.restr < system.file("extdata", "wmb.ex1.restr", package = "MPTinR")
prepare.mpt.fia(c(250,0,0,250,0,0,500,0,0), model.1htm, model.1htm.restr)
## End(Not run)

Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.