Package: EMC2 2.1.0

Niek Stevenson

EMC2: Bayesian Hierarchical Analysis of Cognitive Models of Choice

Fit Bayesian (hierarchical) cognitive models using a linear modeling language interface using particle metropolis Markov chain Monte Carlo sampling with Gibbs steps. The diffusion decision model (DDM), linear ballistic accumulator model (LBA), racing diffusion model (RDM), and the lognormal race model (LNR) are supported. Additionally, users can specify their own likelihood function and/or choose for non-hierarchical estimation, as well as for a diagonal, blocked or full multivariate normal group-level distribution to test individual differences. Prior specification is facilitated through methods that visualize the (implied) prior. A wide range of plotting functions assist in assessing model convergence and posterior inference. Models can be easily evaluated using functions that plot posterior predictions or using relative model comparison metrics such as information criteria or Bayes factors. References: Stevenson et al. (2024) <doi:10.31234/osf.io/2e4dq>.

Authors:Niek Stevenson [aut, cre], Michelle Donzallaz [aut], Andrew Heathcote [aut], Steven Miletić [ctb], Raphael Hartmann [ctb], Karl C. Klauer [ctb], Steven G. Johnson [ctb], Jean M. Linhart [ctb], Brian Gough [ctb], Gerard Jungman [ctb], Rudolf Schuerer [ctb], Przemyslaw Sliwa [ctb], Jason H. Stover [ctb]

EMC2_2.1.0.tar.gz
EMC2_2.1.0.zip(r-4.5)EMC2_2.1.0.zip(r-4.4)EMC2_2.1.0.zip(r-4.3)
EMC2_2.1.0.tgz(r-4.4-x86_64)EMC2_2.1.0.tgz(r-4.4-arm64)EMC2_2.1.0.tgz(r-4.3-x86_64)EMC2_2.1.0.tgz(r-4.3-arm64)
EMC2_2.1.0.tar.gz(r-4.5-noble)EMC2_2.1.0.tar.gz(r-4.4-noble)
EMC2_2.1.0.tgz(r-4.4-emscripten)EMC2_2.1.0.tgz(r-4.3-emscripten)
EMC2.pdf |EMC2.html
EMC2/json (API)
NEWS

# Install 'EMC2' in R:
install.packages('EMC2', repos = c('https://ampl-psych.r-universe.dev', 'https://cloud.r-project.org'))

Peer review:

Bug tracker:https://github.com/ampl-psych/emc2/issues

Uses libs:
  • c++– GNU Standard C++ Library v3
Datasets:
  • forstmann - Forstmann et al.'s data
  • samples_LNR - An emc object of an LNR model of the Forstmann dataset using the first three subjects

On CRAN:

8.21 score 13 stars 310 scripts 305 downloads 44 exports 34 dependencies

Last updated 1 months agofrom:04d614036d. Checks:OK: 9. Indexed: yes.

TargetResultDate
Doc / VignettesOKNov 14 2024
R-4.5-win-x86_64OKNov 14 2024
R-4.5-linux-x86_64OKNov 14 2024
R-4.4-win-x86_64OKNov 14 2024
R-4.4-mac-x86_64OKNov 14 2024
R-4.4-mac-aarch64OKNov 14 2024
R-4.3-win-x86_64OKNov 14 2024
R-4.3-mac-x86_64OKNov 14 2024
R-4.3-mac-aarch64OKNov 14 2024

Exports:chain_ncheckcomparecompare_subjectcontr.anovacontr.bayescontr.decreasingcontr.increasingcredibleDDMdesigness_summaryfitgd_summaryget_BayesFactorget_dataget_parshypothesisinit_chainsLBALNRmake_datamake_emcmake_random_effectsmapped_parmerge_chainspairs_posteriorparametersplot_defective_densityplot_fitplot_parsplot_priorplot_relationsplot_sbc_ecdfplot_sbc_histposterior_summarypriorprofile_plotRDMrecoveryrun_bridge_samplingrun_emcrun_sbcsampled_p_vector

Dependencies:abindBrobdingnagclicodacolorspacecorpcorcorrplotexpmfansigenericsglueGPArotationlatticelifecyclelpSolvemagicmagrittrMASSMatrixmatrixcalcmnormtmsmmvtnormnlmepillarpkgconfigpsychRcpprlangsurvivaltibbleutf8vctrsWienR

Simulation-based Calibration

Rendered fromSimulation-based-Calibration.Rmdusingknitr::rmarkdownon Nov 14 2024.

Last update: 2024-10-14
Started: 2024-10-14

Readme and manuals

Help Manual

Help pageTopics
chain_n()chain_n
Convergence checks for an emc objectcheck check.emc
Information criteria and marginal likelihoodscompare
Information criteria for each participantcompare_subject
Anova style contrast matrixcontr.anova
Contrast to enforce equal prior variance on each levelcontr.bayes
Contrast to enforce decreasing estimatescontr.decreasing
Contrast to enforce increasing estimatescontr.increasing
Posterior credible interval testscredible credible.emc
The Diffusion Decision ModelDDM
Specify a design and modeldesign
Effective sample sizeess_summary ess_summary.emc
Model estimation in EMC2fit fit.emc
Forstmann et al.'s dataforstmann
Gelman-Rubin statisticgd_summary gd_summary.emc
Bayes Factorsget_BayesFactor
Get dataget_data get_data.emc
Filter/manipulate parameters from emc objectget_pars
Within-model hypothesis testinghypothesis hypothesis.emc
Initialize chainsinit_chains
The Linear Ballistic Accumulator modelLBA
The Log-Normal Race ModelLNR
Simulate datamake_data
Make an emc objectmake_emc
Make random effectsmake_random_effects
Parameter mapping back to the design factorsmapped_par
Merge samplesmerge_chains
Plot within-chain correlationspairs_posterior
Returns a parameter type from an emc object as a data frame.parameters parameters.emc
Plot defective densities for each subject and cellplot_defective_density
Posterior predictive checksplot_fit
Plots density for parametersplot_pars
Titleplot_prior
Plot relationsplot_relations
Plot the ECDF difference in SBC ranksplot_sbc_ecdf
Plot the histogram of the observed rank statistics of SBCplot_sbc_hist
Plot function for emc objectsplot.emc
Posterior quantilesposterior_summary posterior_summary.emc
Generate posterior predictivespredict.emc
Prior specificationprior
Likelihood profile plotsprofile_plot
The Racing Diffusion ModelRDM
Recovery plotsrecovery recovery.emc
Estimating Marginal likelihoods using WARP-III bridge samplingrun_bridge_sampling
Custom function for more controlled model estimationrun_emc
Simulation-based calibrationrun_sbc
Get model parameters from a designsampled_p_vector
An emc object of an LNR model of the Forstmann dataset using the first three subjectssamples_LNR
Shorten an emc objectsubset.emc
Summary statistics for emc objectssummary.emc