R package for fitting Response-Time extended Multinomial Processing Tree (RT-MPT) models by Klauer and Kellen (2018)
The model class RT-MPT incorporate response frequencies and response latencies. This enables the estimation of
In total we have for each process one probability parameter and two process completion times (for each outcome of the process one).
rtmpt has two sub-model classes: the exponential RT-MPT uses a Metropolis-within-Gibbs sampler and builds on the C++ code by Klauer and Kellen (2018) with some modifications. The diffusion RT-MPT uses a Hamiltonian-Within-Gibbs sampler and builds on the C++ code by Klauer, Hartmann, and Meyer-Grant (submitted manuscript).
In the exponential RT-MPT (short ertmpt) model class it is possible to
In the diffusion RT-MPT (short drtmpt) model class it is possible to
For more information about the functionalities check the help files or the vignette of the package.
An installation via CRAN is now possible. Write in the command line in R:
install.packages("rtmpt")
Before installing the R package rtmpt you need to install the latest version of the GNU Scientific Library (GSL):
*tar.gz file from GSL
$ cd ~/Downloads/gsl-2.5
./configure
make
sudo make install
For some Linux distributions it is necessary to run sudo ldconfig -v in the terminal before installing rtmpt.
Installing rtmpt is possible either
with the R package devtools and the command devtools::install_github("RaphaelHartmann/rtmpt@master") in R or
with the following steps:
Download all the source files from the rtmpt package above
In the terminal change directory via $ cd ~/Downloads (assuming the rtmpt source folder is in /Downloads)
Execute:
R CMD build rtmpt
R CMD INSTALL rtmpt_<XYZ>.tar.gz
where XYZ stands for the version number.
Before installing the R package rtmpt from source you need to do the following:
brew install gsl
xcode-select --install
open /Library/Developer/CommandLineTools/Packages/macOS_SDK_headers_for_macOS_10.14.pkg
brew install gcc in your terminal.ls /usr/local/bin/ what endings the gcc/g++ executables have (in my case -9)~/.R/Makevars does not already exist, create it with mkdir ~/.R/ and touch ~/.R/Makevars
open ~/.R/Makevars to write the following in the Makevars file (assuming your gcc/g++ executables have the ending -9):
CC=/usr/local/bin/gcc-9
CXX=/usr/local/bin/g++-9
CXX11=/usr/local/bin/g++-9
and save.Installing the rtmpt package:
This is possible either
with the R package devtools and the command devtools::install_github("RaphaelHartmann/rtmpt@master") in R or
with the following steps:
Download all the source files from the rtmpt package above
In the terminal change directory via $ cd ~/Downloads (assuming the rtmpt source folder is in /Downloads)
Execute:
R CMD build rtmpt
R CMD INSTALL rtmpt_<XYZ>.tar.gz
where XYZ stands for the version number.
If you want to cite this package write
Hartmann, R., Johannsen, L., & Klauer, K. C. (2020). rtmpt: An R package for fitting response-time extended multinomial processing tree models. Behavior Research Methods, 52(3), 1313–1338. doi: 10.3758/s13428-019-01318-x
or use the BibTeX code:
@article{Hartmann_2020,
doi = {10.3758/s13428-019-01318-x},
url = {https://doi.org/10.3758%2Fs13428-019-01318-x},
year = 2020,
month = {may},
publisher = {Springer Science and Business Media {LLC}},
volume = {52},
number = {3},
pages = {1313--1338},
author = {Raphael Hartmann and Lea Johannsen and Karl Christoph Klauer},
title = {rtmpt: An R package for fitting response-time extended multinomial processing tree models},
journal = {Behavior Research Methods}
}
Klauer, K. C., & Kellen, D. (2018). RT-MPTs: Process models for response-time distributions based on multinomial processing trees with applications to recognition memory. Journal of Mathematical Psychology, 82, 111-130. 111–130. doi: 10.1016/j.jmp.2017.12.003
Hartmann, R., Johannsen, L., & Klauer, K. C. (2020). rtmpt: An R package for fitting response-time extended multinomial processing tree models. Behavior Research Methods, 52(3), 1313–1338. doi: 10.3758/s13428-019-01318-x
Hartmann, R., & Klauer, K. C. (2020). Extending RT-MPTs to enable equal process times. Journal of Mathematical Psychology, 96, 102340. doi: 10.1016/j.jmp.2020.102340
Galassi, M., Davies, J., Theiler, J., Gough, B., Jungman, G., Alken, P., . . . Ulerich, R. (2018). GNU scientific library [Computer software]. Retrieved from http://www.gnu.org/software/gsl/