Coder Social home page Coder Social logo

fastdminr's Introduction

FastDMinR

FastDMinR is an R interface for fast-dm.

Installation


To install FastDMinR, run:

install.packages("devtools")
library(devtools)
install_github("AdrianJusepeitis/FastDMinR")

How to use


Simply use the function

fast_dm()

to specify the input data and the diffusion model. The function returns a list of parameter estimates and cdf values for evaluating model fit.

Example


You may try using FastDMinR starting with simple simulated data.

data = data.frame(sub = rep(c(1,2), each = 100),
                  cnd = rep(c(1,2), times = 100),
                  RESPONSE = sample (c(0,1), 200, p=c(0.1,0.9), replace = TRUE),
                  TIME = round((rnorm(200,400,30) + rexp(200,0.01))/1000, 2))

Load the package and save the output of fast_dm() in an object.

library(FastDMinR)

results <- fast_dm(data,
                   Subject = "sub",
                   Conditions = "cnd",
                   TIME = "TIME",
                   RESPONSE = "RESPONSE",
                   precision = 5.0,
                   method = "ks",
                   fix_to = list(p = 0, d = 0, sv = 0, st0 = 0, szr = 0),
                   depend_on_condition = list(a = "cnd"),
                   invariant = c("zr", "v", "t0"))

Parameter estimates are now stored in

results$indiv_estimates

and

results$aggr_estimates

Cdf values are stored in

results$cdf$indiv_cdf

and

results$cdf$aggr_cdf

The long format makes it easy to produce the necessary plots with ggplot2:

library(ggplot2)

ggplot(results$cdf$aggr_cdf, aes(x = RT, y = CDF)) + 
  geom_line(aes(lty = cdf_Type), lwd = 1) + 
  facet_grid(. ~ cnd)

fastdminr's People

Contributors

adrianjusepeitis avatar cschwarz007 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.