Giter Site home page Giter Site logo

kiante-fernandez / rhddmjags Goto Github PK

View Code? Open in Web Editor NEW
11.0 3.0 0.0 639 KB

Repository for example Hierarchical Drift Diffusion Model (HDDM) code using JAGS in R. These scripts provide useful examples for using JAGS with R2jags, the JAGS Wiener module, mixture modeling in JAGS, and Bayesian diagnostics in R.

License: GNU General Public License v3.0

R 96.12% Stan 3.88%
decision-making bayesian-inference hddm jags mcmc-methods

rhddmjags's Introduction

Rhddmjags - Repository for example Hierarchical Drift Diffusion Model (HDDM) code using JAGS in R

(Repository version 0.0.0.9002)

Prerequisites

  • install R and RStudio on a laptop
  • install the packages {R2jags}, {coda} from CRAN
  • install JAGS
  • install JAGS Wiener module

Installation

You can install the packages used in these tutorials and get functions that makes it easy to access the templates .Rmd files by running the following code:

devtools::install_github('kiante-fernandez/Rhddmjags')

Getting started

At the moment each script can be run individually to simulate from hierarchical drift-diffusion models (HDDMs) and then find and recover parameter estimates from those models. The most simple HDDM lives in nolapse_test.R. See other scripts: recovery_test.R, blocked_exp_conds.R, and regression_test.R. These scripts provide useful examples for using JAGS with Rjags, the JAGS Wiener module, mixture modeling in JAGS, and Bayesian diagnostics in R.

The script nolapse_test_Rstan.R contains Rstan and Stan code to find and recover parameters from the exact same HDDM written in JAGS within nolapse_test.R.

Then you can load examples with the following code:

Rhddmjags::example("simple", "jags")
Rhddmjags::example("nolapse","stan")

Resources

Past Workshops

citation

Nunez, M.D., Fernandez, K., Srinivasan, R. et al. A tutorial on fitting joint models of M/EEG and behavior to understand cognition. Behav Res (2024). https://doi.org/10.3758/s13428-023-02331-x

License

Rhddmjags is licensed under the GNU General Public License v3.0 and written by Kianté Fernandez from the Neruoeconomics group at University of California, Los Angeles.

rhddmjags's People

Contributors

kiante-fernandez avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.