ggdmcModel

ggdmcModel provides tools for specifying and examining experimental design associated with cognitive models (e.g., diffusion decision models) for use with the 'ggdmc' package.

https://github.com/yxlin/ggdmcmodel

Science Score: 26.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
    Found .zenodo.json file
  • DOI references
  • Academic publication links
  • Academic email domains
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (9.1%) to scientific vocabulary
Last synced: 9 months ago · JSON representation

Repository

ggdmcModel provides tools for specifying and examining experimental design associated with cognitive models (e.g., diffusion decision models) for use with the 'ggdmc' package.

Basic Info
  • Host: GitHub
  • Owner: yxlin
  • Language: R
  • Default Branch: main
  • Size: 5.92 MB
Statistics
  • Stars: 0
  • Watchers: 0
  • Forks: 0
  • Open Issues: 0
  • Releases: 0
Created 12 months ago · Last pushed 10 months ago
Metadata Files
Readme

README.md

ggdmcModel

CRAN Status Downloads License: GPL-3 R-CMD-check

ggdmcModel provides a suite of tools for specifying and examining experimental designs for choice response time models, such as the Diffusion Decision Model (DDM) and Linear Ballistic Accumulator (LBA).
It enables users to define how experimental factors influence one or more model parameters using R-style formula syntax, while ensuring logical consistency of these associations.

The package integrates with the ggdmc package, which employs Differential Evolution Markov Chain Monte Carlo (DE-MCMC) sampling for parameter estimation in hierarchical Bayesian models.


📦 Prerequisites

  • R (≥ 3.5.0)
  • Rcpp (≥ 1.0.7)
  • methods
  • RcppArmadillo (≥ 0.10.7.5.0)
  • ggdmcHeaders (≥ 0.2.9.1)

📥 Installation

From CRAN: r install.packages("ggdmcModel")

🚀 Getting Started

Example 1 – Minimal LBA Model

```r library(ggdmcModel)

model <- BuildModel( pmap = list(A = "1", B = "1", t0 = "1", meanv = "M", sdv = "1", st0 = "1"), matchmap = list(M = list(s1 = "r1", s2 = "r2")), factors = list(S = c("s1", "s2")), constants = c(st0 = 0, sd_v = 1), accumulators = c("r1", "r2"), type = "lba" ) ```

Example 2 – Minimal DDM Model

```r library(ggdmcModel)

model <- BuildModel( pmap = list( a = "1", v = "1", z = "1", d = "1", sz = "1", sv = "1", t0 = "1", st0 = "1", s = "1", precision = "1" ), matchmap = list(M = list(s1 = "r1", s2 = "r2")), factors = list(S = c("s1", "s2")), constants = c(d = 0, s = 1, st0 = 0, sv = 0, precision = 3), accumulators = c("r1", "r2"), type = "fastdm" )

slotNames(model)

[1] "parameter_map" "accumulators"

[3] "factors" "match_map"

[5] "constants" "cell_names"

[7] "parameterxconditionnames" "modelboolean"

[9] "pnames" "npar"

[11] "type"

```

Example 3 – Factor-to-Parameter Mapping in DDM

The following example shows how BuildModel assigns two different drift rates (v) for two levels of a stimulus factor S:

```r library(ggdmcModel)

model <- BuildModel( pmap = list(a = "1", v = "S", z = "1", d = "1", sz = "1", sv = "1", t0 = "1", st0 = "1", s = "1"), matchmap = list(M = list(s1 = "r1", s2 = "r2")), factors = list(S = c("s1", "s2")), constants = c(d = 1, s = 1, sv = 1, sz = 0.5, st0 = 0), accumulators = c("r1", "r2"), type = "fastdm" )

pnames <- get_pnames(model)

p_vector <- c(a = 1, sv = 0.2, sz = 0.25, t0 = 0.15, v.s1 = 4, v.s2 = 2, z = .38)

tmpparameters <- c(0.8367, 0.0324, 3.8186, 2.8186, 0.1) pmat <- tableparameters(model, tmp_parameters)

result <- lapply(pmat, function(x) t(x)) print(result)

```

Example output:

```bash $s1.r1 a d s st0 sv sz t0 v z r1 0.8367 1 1 0 1 0.5 0.0324 3.8186 0.1 r2 0.8367 1 1 0 1 0.5 0.0324 3.8186 0.1

$s2.r2 a d s st0 sv sz t0 v z r1 0.8367 1 1 0 1 0.5 0.0324 2.8186 0.1 r2 0.8367 1 1 0 1 0.5 0.0324 2.8186 0.1 ```

📄 License

GPL (≥ 3)

Owner

  • Name: Yi-Shin Lin
  • Login: yxlin
  • Kind: user

GitHub Events

Total
  • Push event: 9
Last Year
  • Push event: 9

Packages

  • Total packages: 1
  • Total downloads:
    • cran 225 last-month
  • Total dependent packages: 0
  • Total dependent repositories: 0
  • Total versions: 1
  • Total maintainers: 1
cran.r-project.org: ggdmcModel

Model Builders for 'ggdmc' Package

  • Versions: 1
  • Dependent Packages: 0
  • Dependent Repositories: 0
  • Downloads: 225 Last month
Rankings
Dependent packages count: 25.8%
Dependent repos count: 31.8%
Average: 47.7%
Downloads: 85.6%
Maintainers (1)
Last synced: 10 months ago

Dependencies

DESCRIPTION cran
  • R >= 3.5.0 depends
  • Rcpp >= 1.0.7 imports
  • methods * imports
  • testthat * suggests
.github/workflows/rhub.yaml actions
  • r-hub/actions/checkout v1 composite
  • r-hub/actions/platform-info v1 composite
  • r-hub/actions/run-check v1 composite
  • r-hub/actions/setup v1 composite
  • r-hub/actions/setup-deps v1 composite
  • r-hub/actions/setup-r v1 composite