# History of the hmetad package

The `hmetad` package is the most recent implementation of the meta-d’ model, developed by Brian Maniscalco and Hakwan Lau (Maniscalco & Lau, 2012). This model has had several implementations since its creation.

The first implementation of the model used maximum likelihood estimation for single participant data (Maniscalco & Lau, 2012), and is still available for download here. The original code is written in MATLAB and a version is also available in Python.

The model was later implemented by (Fleming, 2017) in a hierarchical Bayesian framework, which has been shown to provide much more reliable estimates in the relatively small sample sizes commonly used in psychological experiments. This version, known as the Hmeta-d toolbox, was implemented in the probabilistic programming language JAGS, which in turn has interfaces in both MATLAB and in R.

The `hmetad` package builds on these previous versions through implementation in the `brms` package in R, retaining the hierarchical Bayesian approach of the Hmeta-d toolbox while also allowing for flexible estimation of parameters within arbitrarily complex regression designs. Additionally, `brms` uses the probabilistic programming language Stan, which permits much more efficient sampling with more reliable model convergence warnings and extensive diagnostics. Because of its increased efficiency and flexibility, the `hmetad` package is our recommended approach to fitting the meta-d’ model.

## References

Fleming, S. M. (2017). HMeta-d: Hierarchical bayesian estimation of metacognitive efficiency from confidence ratings. Neuroscience of Consciousness, 2017(1), nix007.
Maniscalco, B., & Lau, H. (2012). A signal detection theoretic approach for estimating metacognitive sensitivity from confidence ratings. Consciousness and Cognition, 21(1), 422–430.