Presentation is loading. Please wait.

Presentation is loading. Please wait.

Introduction We present a package for the analysis of (non-hierarchical) Multinomial Processing Tree (MPT) models for the statistical programming language.

Similar presentations


Presentation on theme: "Introduction We present a package for the analysis of (non-hierarchical) Multinomial Processing Tree (MPT) models for the statistical programming language."— Presentation transcript:

1 Introduction We present a package for the analysis of (non-hierarchical) Multinomial Processing Tree (MPT) models for the statistical programming language R: MPTinR. MPTinR combines two approaches, extending the functionality of other software for MPTs: ease of use and amount of functionalities. The homepage of MPTinR (including documentation) is: http://www.psychologie.unifreiburg.de/Members/singmann/R/mptinr Introduction We present a package for the analysis of (non-hierarchical) Multinomial Processing Tree (MPT) models for the statistical programming language R: MPTinR. MPTinR combines two approaches, extending the functionality of other software for MPTs: ease of use and amount of functionalities. The homepage of MPTinR (including documentation) is: http://www.psychologie.unifreiburg.de/Members/singmann/R/mptinr Features The advantages of MPTinR over similar programs for fitting MPTs are: MPTinR is an R package and therefore integrates smoothly with a R-workflow. MPTinR is free software and open source! MPTinR allows an easy and intuitive way to specify the model in a file that even allows comments (via “#”). Furthermore, MPTinR supports the 'classical' EQN syntax (as GPT, HMMTree, MultiTree). Sequential equality and inequality model restrictions can be specified in an external file. MPTinR provides different outputs for individual and datasets consisting of multiple individuals. In the latter case, results for each individual, sums of the individual results, and results from aggregating the data are automatically provided. For model selection, the Fisher information approximation (FIA), a minimum description length based measure of model complexity, can be obtained using the algorithm provided by Wu, Myung and Batchelder (2010). For multiple individuals or multiple fitting runs the package allows one to easily use multiple cores (or CPUs) via the snowfall package by simply specifying the number of available cores. Features The advantages of MPTinR over similar programs for fitting MPTs are: MPTinR is an R package and therefore integrates smoothly with a R-workflow. MPTinR is free software and open source! MPTinR allows an easy and intuitive way to specify the model in a file that even allows comments (via “#”). Furthermore, MPTinR supports the 'classical' EQN syntax (as GPT, HMMTree, MultiTree). Sequential equality and inequality model restrictions can be specified in an external file. MPTinR provides different outputs for individual and datasets consisting of multiple individuals. In the latter case, results for each individual, sums of the individual results, and results from aggregating the data are automatically provided. For model selection, the Fisher information approximation (FIA), a minimum description length based measure of model complexity, can be obtained using the algorithm provided by Wu, Myung and Batchelder (2010). For multiple individuals or multiple fitting runs the package allows one to easily use multiple cores (or CPUs) via the snowfall package by simply specifying the number of available cores. Installation MPTinR is hosted on R-Forge: https://r-forge.r-project.org/ To install simply type at an R prompt: install.packages("MPTinR", repos="http://R- Forge.R-project.org") Installation MPTinR is hosted on R-Forge: https://r-forge.r-project.org/ To install simply type at an R prompt: install.packages("MPTinR", repos="http://R- Forge.R-project.org") * Contact: henrik.singmann@psychologie.uni-freiburg.de http://www.psychologie.unifreiburg.de/Members/singmann/R/mptinr * Contact: henrik.singmann@psychologie.uni-freiburg.de http://www.psychologie.unifreiburg.de/Members/singmann/R/mptinr Model Files MPTinR allows two ways two specify the model file: 1.The new “easy” format 2.The classical EQN format. Furthermore, MPTinR can create EQN model files from models specified in the “easy” format via the function make.eqn(). Next, we compare model files for the sample 2HTM model (on the right) for both formats: Model Files MPTinR allows two ways two specify the model file: 1.The new “easy” format 2.The classical EQN format. Furthermore, MPTinR can create EQN model files from models specified in the “easy” format via the function make.eqn(). Next, we compare model files for the sample 2HTM model (on the right) for both formats: Easy FormatEQN Format Trees are separated by at least one empty line. Model files can contain comments (via “#”) Needs a special syntax (see e.g., Stahl & Klauer, 2007) This file was constructed using make.eqn() #Tree for old items Do + (1 - Do) * g (1-Do)*(1-g) #Tree for new items (1-Dn) * g Dn + (1-Dn) * (1 - g) 6 1 1 Do 1 1 (1-Do)*g 1 2 (1-Do)*(1-g) 2 4 Dn 2 3 (1-Dn)*g 2 4 (1-Dn)*(1-g) MPTinR allows two ways two specify the model file: Restrictions Files Model restrictions can be specified in an external file. MPTinR allows for sequential equality (“=“) and inequality (“<“) restrictions. Restriction files can contain comments (“#”) Models are reparametrized to accommodate the restrictions (using “method A”; Knapp & Batchelder, 2004). Restrictions Files Model restrictions can be specified in an external file. MPTinR allows for sequential equality (“=“) and inequality (“<“) restrictions. Restriction files can contain comments (“#”) Models are reparametrized to accommodate the restrictions (using “method A”; Knapp & Batchelder, 2004). # Example: #Ds are ordered D1 < D2 < D3 #D4 equal to D2 D4 = D2 # Bs set to.33 B1 = B3 = 0.33333 X4 = X5 = G6 Fitting Algorithm Fitting is done by the general purpose optimization routine L-BFGS-B (Byrd et al., 1995), a quasi-Newton (i.e., gradient-based) method. Multiple fitting runs (with random starting values) can be initiated to avoid local minima. Alternatively, starting values can be specified. Currently other algorithms (e.g., simplex) are being implemented. Fitting Algorithm Fitting is done by the general purpose optimization routine L-BFGS-B (Byrd et al., 1995), a quasi-Newton (i.e., gradient-based) method. Multiple fitting runs (with random starting values) can be initiated to avoid local minima. Alternatively, starting values can be specified. Currently other algorithms (e.g., simplex) are being implemented. Example: Model Fitting Fitting the 2HTM to the data from Bröder & Schütz (2009, Exp. 3) : > fit.mpt(d.broeder, m.2htm, fia = 200000) $goodness.of.fit Log.Likelihood G.Squared df p.value 1 -5376.127 2.835736 3 0.4176509 $information.criteria FIA AIC BIC 1 26.30482 16.83574 68.58437 $model.info rank.hessian n.parameters n.independent.categories 1 7 7 10 $parameters estimates lower.conf upper.conf Dn 0.4450280 0.3716406 0.5184154 Do 0.5561321 0.5102135 0.6020507 G1 0.1411024 0.1129999 0.1692050 G2 0.2152994 0.1736187 0.2569800 G3 0.3998431 0.3388254 0.4608608 G4 0.6045673 0.5446873 0.6644472 G5 0.6895503 0.6424602 0.7366405 $data $data$observed [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [1,] 145 95 170 1990 402 198 211 1589 868 [...] $data$predicted [,1] [,2] [,3] [,4] [,5] [1,] 148.5031 91.4969 169.145 1990.855 391.0179 [...] For individual data the output would contain the single elements (e.g., goodness.of.fit, parameters ) for the individual data, the sum of the individual data, and the aggregated data. Example: Model Fitting Fitting the 2HTM to the data from Bröder & Schütz (2009, Exp. 3) : > fit.mpt(d.broeder, m.2htm, fia = 200000) $goodness.of.fit Log.Likelihood G.Squared df p.value 1 -5376.127 2.835736 3 0.4176509 $information.criteria FIA AIC BIC 1 26.30482 16.83574 68.58437 $model.info rank.hessian n.parameters n.independent.categories 1 7 7 10 $parameters estimates lower.conf upper.conf Dn 0.4450280 0.3716406 0.5184154 Do 0.5561321 0.5102135 0.6020507 G1 0.1411024 0.1129999 0.1692050 G2 0.2152994 0.1736187 0.2569800 G3 0.3998431 0.3388254 0.4608608 G4 0.6045673 0.5446873 0.6644472 G5 0.6895503 0.6424602 0.7366405 $data $data$observed [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [1,] 145 95 170 1990 402 198 211 1589 868 [...] $data$predicted [,1] [,2] [,3] [,4] [,5] [1,] 148.5031 91.4969 169.145 1990.855 391.0179 [...] For individual data the output would contain the single elements (e.g., goodness.of.fit, parameters ) for the individual data, the sum of the individual data, and the aggregated data. Fisher Information Approximation The Fisher Information Approximation (FIA) is a minimum description length based measure of model complexity. The FIA measures complexity not only by the number of parameters (as do AIC and BIC) but estimates the functional form of the model. MPTinR can compute the FIA for any MPT using the MCMC algorithm by Wu, Myung and Batchelder (2010) ported to R. To this end MPTinR first transforms the model into the context free language of MPT Models (L-BMPT; Purdy & Batchelder, 2009). The example 2HTM (see section “Model Files”) in L-BMPT is: hj1 Do 1 g 1 2 Dn 4 g 3 4 (numbers refer to response categories, the parameter hj1 joins both trees into a single tree) Fisher Information Approximation The Fisher Information Approximation (FIA) is a minimum description length based measure of model complexity. The FIA measures complexity not only by the number of parameters (as do AIC and BIC) but estimates the functional form of the model. MPTinR can compute the FIA for any MPT using the MCMC algorithm by Wu, Myung and Batchelder (2010) ported to R. To this end MPTinR first transforms the model into the context free language of MPT Models (L-BMPT; Purdy & Batchelder, 2009). The example 2HTM (see section “Model Files”) in L-BMPT is: hj1 Do 1 g 1 2 Dn 4 g 3 4 (numbers refer to response categories, the parameter hj1 joins both trees into a single tree) Future Developments Parametric/Nonparametric Bootstrap and Jackknife methods Latent Class hierarchical modeling Normalized Maximum Likelihood approximation Increase Computing Performance Future Developments Parametric/Nonparametric Bootstrap and Jackknife methods Latent Class hierarchical modeling Normalized Maximum Likelihood approximation Increase Computing Performance References Bröder, A., & Schütz, J. (2009). Recognition ROCs are curvilinear—or are they? On premature arguments against the two-high-threshold model of recognition. Journal of Experimental Psychology: Learning, Memory, and Cognition, 35(3), 587. Byrd, R. H., Lu, P., Nocedal, J., & Zhu, C. (1995). A limited memory algorithm for bound constrained optimization. SIAM J. Scientific Computing, 16, 1190-1208. Knapp, B. R., & Batchelder, W. H. (2004). Representing parametric order constraints in multi- trial applications of multinomial processing tree models. Journal of Mathematical Psychology, 48, 215-229. Purdy, B. P., & Batchelder, W. H. (2009). A context-free language for binary multinomial processing tree models. Journal of Mathematical Psychology, 53, 547-561. Stahl, C., & Klauer, K. C. (2007). HMMTree: A computer program for latent-class hierarchical multinomial processing tree models. Behavior Research Methods, 39, 267–273. Wu, H., Myung, J.I., & Batchelder, W.H. (2010). Minimum description length model selection of multinomial processing tree models. Psychonomic Bulletin & Review, 17, 275-286. References Bröder, A., & Schütz, J. (2009). Recognition ROCs are curvilinear—or are they? On premature arguments against the two-high-threshold model of recognition. Journal of Experimental Psychology: Learning, Memory, and Cognition, 35(3), 587. Byrd, R. H., Lu, P., Nocedal, J., & Zhu, C. (1995). A limited memory algorithm for bound constrained optimization. SIAM J. Scientific Computing, 16, 1190-1208. Knapp, B. R., & Batchelder, W. H. (2004). Representing parametric order constraints in multi- trial applications of multinomial processing tree models. Journal of Mathematical Psychology, 48, 215-229. Purdy, B. P., & Batchelder, W. H. (2009). A context-free language for binary multinomial processing tree models. Journal of Mathematical Psychology, 53, 547-561. Stahl, C., & Klauer, K. C. (2007). HMMTree: A computer program for latent-class hierarchical multinomial processing tree models. Behavior Research Methods, 39, 267–273. Wu, H., Myung, J.I., & Batchelder, W.H. (2010). Minimum description length model selection of multinomial processing tree models. Psychonomic Bulletin & Review, 17, 275-286. Example: Model Selection Output of the model selection function comparing the fits of 40 individual data sets from Bröder & Schütz (2009, Exp. 3) to the original 2HTM, a restricted 2HTM (Do = Dn), and a 1HTM (Dn = 0). select.mpt() takes the outputs from fit.mpt() and creates the following table: > select.mpt(list(orig.2htm = br.2htm, res.2htm = br.2htm.res, orig.1htm = br.1htm)) model n.parameters delta.FIA.sum FIA.best delta.AIC.sum wAIC.sum AIC.best delta.BIC.sum wBIC.sum BIC.best 1 orig.2htm 7 0.000000 16 28.46578 0.000001 4 176.61708 0 0 2 res.2htm 6 5.589522 24 0.00000 0.999999 22 0.00000 1 26 3 orig.1htm 6 50.612035 0 43.90706 0.000000 14 43.90706 0 14 Example: Model Selection Output of the model selection function comparing the fits of 40 individual data sets from Bröder & Schütz (2009, Exp. 3) to the original 2HTM, a restricted 2HTM (Do = Dn), and a 1HTM (Dn = 0). select.mpt() takes the outputs from fit.mpt() and creates the following table: > select.mpt(list(orig.2htm = br.2htm, res.2htm = br.2htm.res, orig.1htm = br.1htm)) model n.parameters delta.FIA.sum FIA.best delta.AIC.sum wAIC.sum AIC.best delta.BIC.sum wBIC.sum BIC.best 1 orig.2htm 7 0.000000 16 28.46578 0.000001 4 176.61708 0 0 2 res.2htm 6 5.589522 24 0.00000 0.999999 22 0.00000 1 26 3 orig.1htm 6 50.612035 0 43.90706 0.000000 14 43.90706 0 14 Poster presented at the 44th Annual Meeting of the Society for Mathematical Psychology, Boston, Massachusetts, July 2011 MPTinR: An (almost) complete R package for analyzing Multinomial Processing Tree Models Henrik Singmann*, David Kellen, Fabian Hölzenbein, & Christoph Klauer University of Freiburg


Download ppt "Introduction We present a package for the analysis of (non-hierarchical) Multinomial Processing Tree (MPT) models for the statistical programming language."

Similar presentations


Ads by Google