Skip to contents

About bmm

These pages provide a summary of the functionality available in bmm

bmm-package
Easy and Accesible Bayesian Measurement Models Using 'brms'
bmm_models()
Measurement models available in bmm
bmm_options()
View or change global bmm options
bmm_setup()
Check whether this machine can fit bmm models

Fitting models

Main functions for model fitting

bmm() fit_model()
Fit Bayesian Measurement Models
bmmformula() bmf()
Create formula for predicting parameters of a bmmodel
update(<bmmfit>)
Update a bmm model
summary(<bmmfit>)
Create a summary of a fitted model represented by a bmmfit object
conditional_effects(<bmmfit>)
Conditional Effects for BMM Models
recover_data(<bmmfit>) emm_basis(<bmmfit>)
emmeans support for bmmfit objects
pp_check(<bmmfit>)
Posterior predictive check for bmmfit objects
ppp()
Posterior predictive p-values for count models
posterior_epred(<bmmfit>) fitted(<bmmfit>)
Expected response of a fitted bmm model

Model evaluation & post-processing

ROC/AUC, quantile-transformed ROC, and latent-distribution analysis for signal detection models

roc_sdt()
Model-implied ROC curve from a fitted SDT model
roc_observed()
Observed ROC points from a fitted SDT model
auc_sdt()
Area under the ROC curve from a fitted SDT model
latent_sdt()
Model-implied latent decision-variable distributions
sdt_thresholds()
Latent decision thresholds from a fitted rating SDT model
mratio()
Metacognitive efficiency (M-ratio) from a fitted meta-d' SDT model
sdt_sensitivity()
Sensitivity on the noise, signal, or root-mean-square scale
plot(<bmm_sdt_roc>)
Plot a model-implied SDT ROC curve
plot(<bmm_sdt_auc>)
Plot the posterior AUC distribution from a fitted SDT model
plot(<bmm_sdt_latent>)
Plot the latent decision-variable distributions of an SDT model

Extract model information

Utility functions for extracting default priors, generate stan code, stan data, etc.

bmm_data_check()
Human-readable pre-fit data report for bmm models
default_prior(<bmmformula>)
Get Default priors for Measurement Models specified in BMM
extract_parameter_dimensions()
Extract dimension from parameters in STAN parameter block
extract_stan_blocks()
Extract code from different STAN program blocks
fit_info()
Extract information from a brmsfit object
model_citation()
References for a measurement model
native_parameters()
Posterior draws of model parameters on the native scale
parameter_info()
Get parameter information for a bmm model
pp_check_vars()
List the posterior predictive checks available for a model fit
prior_info()
Priors of a fitted bmm model and where they came from
stancode(<bmmformula>)
Generate Stan code for bmm models
standata(<bmmformula>)
Stan data for bmm models

Specifying models

Functions for specifying which model to fit

cswald()
Censored-Shifted Wald Model
ddm()
Diffusion Decision Model
ezdm()
EZ-Diffusion Model
imm() IMMfull() IMMbsc() IMMabc()
Interference measurement model by Oberauer and Lin (2017).
m3()
The Multinomial / Memory Measurement Model
mixture2p()
Two-parameter mixture model by Zhang and Luck (2008).
mixture3p()
Three-parameter mixture model by Bays et al (2009).
mpt()
Multinomial Processing Tree (MPT) models
mpt_from_eqn()
Create an MPT model from an EQN model file
mpt_from_string()
Create an MPT model from an MPTinR-style model string
mpt_tree()
Create a tree for a Multinomial Processing Tree (MPT) model
plot(<mpt_tree>) plot(<mpt>)
Plot the structure of MPT trees
sdm() sdmSimple()
Signal Discrimination Model (SDM) by Oberauer (2023)
sdt_cdp()
Continuous Dual-Process Signal Detection Theory Model
sdt_mafc()
m-Alternative Forced Choice Signal Detection Theory Model
sdt_ranking()
Ranking Signal Detection Theory Model
sdt_rating()
Confidence Rating Signal Detection Theory Model
sdt_yn()
Yes/No Signal Detection Theory Model

Distributions

Functions for special distributions

dimm() pimm() qimm() rimm()
Distribution functions for the Interference Measurement Model (IMM)
dsdm() psdm() qsdm() rsdm()
Distribution functions for the Signal Discrimination Model (SDM)
sdt_d() sdt_criterion() sdt_bias()
Utility functions for Signal Detection Theory
dcswald() rcswald() pcswald() qcswald()
Distribution functions for the censored shifted Wald model (cswald)
dddm() rddm()
Distribution function for the Diffusion Decision Model (ddm)
dezdm() rezdm()
Distribution functions for the EZ-Diffusion Model (ezdm)
dm3() rm3()
Distribution functions for the Memory Measurement Model (M3)
dmixture2p() pmixture2p() qmixture2p() rmixture2p()
Distribution functions for the two-parameter mixture model (mixture2p)
dmixture3p() pmixture3p() qmixture3p() rmixture3p()
Distribution functions for the three-parameter mixture model (mixture3p)
dmpt() rmpt()
Distribution functions for Multinomial Processing Tree (MPT) models
rejection_sampling()
Rejection Sampling
dsdt_cdp() rsdt_cdp()
Distribution functions for Continuous Dual-Process SDT (CDP)
dsdt_dpsdt() rsdt_dpsdt()
Distribution functions for dual-process SDT (DPSDT)
dsdt_mafc() rsdt_mafc()
Distribution functions for m-AFC SDT
dsdt_metad() rsdt_metad()
Distribution functions for meta-d' SDT
dsdt_ranking() rsdt_ranking()
Distribution functions for Ranking SDT
dsdt_rating() rsdt_rating()
Distribution functions for Confidence Rating SDT
dsdt_yn() rsdt_yn()
Distribution functions for Yes/No SDT

Data, model and parameter transformations

Utility functions for transforming data and parameters

adjust_ezdm_accuracy()
Adjust Accuracy Counts for Contamination (deprecated)
aggregate_sdt_cdp_data()
Aggregate long-format Remember/Know data for sdt_cdp()
c_sqrtexp2bessel() c_bessel2sqrtexp()
Convert between parametrizations of the c parameter of the SDM distribution
calc_error_relative_to_nontargets()
Calculate response error relative to non-target values
deg2rad() rad2deg()
Convert degrees to radians or radians to degrees.
construct_m3_act_funs()
Get Activation Functions for different M3 versions
ezdm_summary_stats()
Compute Robust Summary Statistics for EZ-Diffusion Model
flag_contaminant_rts()
Flag contaminant reaction times using mixture modeling
k2sd()
Transform kappa of the von Mises distribution to the circular standard deviation
mpt_data_reshape()
Reshape wide MPT frequency tables to the long format of bmm()
restructure(<bmmfit>)
Restructure Old bmmfit Objects
softmax() softmaxinv()
Softmax function and its inverse
validate_fast_guesses()
Test if fast contaminants show random guessing behavior
wrap()
Wrap angles that extend beyond (-pi;pi)

Datasets

Available datasets for fitting the models

broeder_schuetz_2009_e3
Recognition ROC data from Broeder & Schuetz (2009, Experiment 3)
data_color_judgement_task
Example Data from a Color Judgement Task
meyer_grant_jakob_2025
Ranking recognition data from Meyer-Grant & Jakob (2025)
oberauer_lewandowsky_2019_e1
Data from Experiment 1 reported by Oberauer & Lewandowsky (2019)
oberauer_lin_2017
Data from Experiment 1 reported by Oberauer & Lin (2017)
zhang_luck_2008
Data from Experiment 2 reported by Zhang & Luck (2008)

Developers’ corner

Functions to assist in developing new models

apply_links()
Apply link functions for parameters in a formula or bmmformula
bmf2bf()
Convert bmmformula objects to brmsformula objects
check_data()
Generic S3 method for checking data based on model type
check_formula()
Generic S3 method for checking if the formula is valid for the specified model
check_model()
Generic S3 method for checking if the model is supported and model preprocessing
configure_model()
Generic S3 method for configuring the model to be fit by brms
configure_prior()
Generic S3 method for configuring the default prior for a bmmodel
create_initfun()
Generic S3 method for creating an initial values function
data_check_finding()
Construct a single finding for a pre-fit data report
data_check_findings()
Generic S3 method for model-specific pre-fit data findings
native_transform()
Transform parameter draws from the sampling scale to the native scale
postprocess_brm()
Generic S3 method for postprocessing the fitted brm model
pp_observables() pp_simulate()
Declare the observables of a bmm model for posterior predictive checks
print_model_details()
Generic S3 method for model-specific lines in print() of a model
revert_postprocess_brm()
Generic S3 method for reverting any postprocessing of the fitted brm model
use_model_template()
Create a file with a template for adding a new model (for developers)