-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- fix a few typos - remove @ref to figures, as these don't work in github_document format - fix rendering of nested list on lines 95-102 - add links to vignettes
- Loading branch information
Showing
5 changed files
with
837 additions
and
42 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -16,7 +16,7 @@ knitr::opts_chunk$set( | |
<!-- badges: end --> | ||
|
||
The goal of bmm (Bayesian Measurement Models) is to make it easier to estimate | ||
common cognitive measurement models for behavioral research using Bayesian hierarhical | ||
common cognitive measurement models for behavioral research using Bayesian hierarchical | ||
estimation via the 'brms' package'. Cognitive measurement models provide a more refined representation of the cognitive processes underlying observed behavior, because they decompose observed behavior into several theoretically meaningful parameters that each represent distinct cognitive processes. | ||
|
||
Currently the bmm package implements mainly models used in the domain of visual working memory research: | ||
|
@@ -55,6 +55,8 @@ If you want to install the package together with the vignettes, you can use: | |
devtools::install_github("venpopov/bmm", build_vignettes = TRUE) | ||
``` | ||
|
||
All the vignettes are also available on the [bmm website](https://venpopov.github.io/bmm/). | ||
|
||
The package was significantly updated on Feb 03, 2024. If you are following older versions (earlier than Version 6) of the [Tutorial preprint](https://osf.io/preprints/psyarxiv/umt57), you need to install the 0.0.1 version of the bmm package with: | ||
|
||
``` r | ||
|
@@ -64,12 +66,14 @@ devtools::install_github("venpopov/[email protected]") | |
|
||
## The general structure of the bmm package | ||
|
||
The main building block of the bmm package is that cognitive measurement models can often be specified as distributional models for which the distributional parameters of the generalized linear mixed model are a function of cognitive measurement model parameters (again see \@ref(fig:bmm-logic) for an illustration). These functions that translate the cognitive measurement model parameters into distributional parameters is what we implement in the bmm package. | ||
The main building block of the bmm package is that cognitive measurement models can often be specified as distributional models for which the distributional parameters of the generalized linear mixed model are a function of cognitive measurement model parameters. These functions that translate the cognitive measurement model parameters into distributional parameters is what we implement in the bmm package. | ||
|
||
|
||
```{r bmm-logic, echo=F, fig.cap="", out.width=600, fig.align = 'center'} | ||
knitr::include_graphics("vignettes/bmmLogic.jpg") | ||
``` | ||
|
||
|
||
As these function can become complicated and their implementation changes with differences in experimental designs, the bmm package provides general translation functions that eases the use of the cognitive measurement models for end users. This way researchers that face challenges in writing their own STAN code to implement such models themselves can still use these models in almost any experimental design. | ||
|
||
### Fitting models using the bmm | ||
|
@@ -89,15 +93,15 @@ You can get more detailed information on the models implemented in bmm by invoki | |
The function will then call the appropriate functions for the specified model and will perform several steps: | ||
|
||
1. Configure the Sample (e.g., set up prallelization) | ||
2. Check the information passed to the `fit_model` function | ||
a. if the model is installed and all required arguements were provided | ||
b. if a valid formula was passed | ||
c. if the data contains all necessary variables | ||
2. Check the information passed to the `fit_model` function: | ||
- if the model is installed and all required arguments were provided | ||
- if a valid formula was passed | ||
- if the data contains all necessary variables | ||
3. Configure the called model (including specifying priors were necessary) | ||
4. Calling `brms` and passing the specified arguements | ||
4. Calling `brms` and passing the specified arguments | ||
5. Posprocessing the output and passing it to the user | ||
|
||
This process is illustrated in \@ref(fig:fitModel). | ||
This process is illustrated in the Figure below: | ||
|
||
```{r fitModel, echo=F, fig.cap="", out.width=600, fig.align = 'center'} | ||
knitr::include_graphics("vignettes/fitModel_process.jpg") | ||
|
@@ -110,7 +114,7 @@ library(bmm) | |
data <- OberauerLin_2017 | ||
``` | ||
|
||
For this quick example, we will show hot to setup fitting the Interference Measurement Model to this data. If you want a detailed description of this model and and in depth explanation of the parameters estimated in the model, please have a look at the IMM vignette. | ||
For this quick example, we will show hot to setup fitting the Interference Measurement Model to this data. If you want a detailed description of this model and and in depth explanation of the parameters estimated in the model, please have a look at `vignette("IMM")`. | ||
|
||
``` r | ||
model_formula <- brms::bf(dev_rad ~ 1, | ||
|
@@ -140,13 +144,7 @@ summary(fit) | |
brms::pp_check(fit) | ||
``` | ||
|
||
You can have a look at examples for how to fit all currently implemented models by reading the vignettes for each model. Currently there are Vignettes, for the following models: | ||
|
||
```{r echo=FALSE} | ||
vignette_files <- list.files(path = "vignettes", pattern = ".Rmd") | ||
vignette_files <- stringr::str_remove(vignette_files,".Rmd") | ||
print(vignette_files) | ||
``` | ||
You can have a look at examples for how to fit all currently implemented models by reading the vignettes for each model [here for the released version of the package](https://venpopov.github.io/bmm/articles/index.html) or [here for the development version](https://venpopov.github.io/bmm/dev/articles/index.html). | ||
|
||
|
||
### Exploring cogntive measurement models | ||
|
Oops, something went wrong.