Circular Drift-Diffusion Model

Circular drift-diffusion model for continuous reports.


CircularDDM implements circular drift-diffusion model, using Armadillo C++.

MATLAB callable functions reside in inst/matlab folder. Currently, we provide only Linux binary (mexa64 files compiled by g++ 5.4.0). If the libraries, GNU gsl and armadillo C++ (requiring LAPACK and BLAS), are installed, one should be able to compile the source codes in other systems, such as Windows (mexw64 files) and OS X (mexmaci64 files).

Getting Started

The following examples are extracted from CircularDDM help pages

require(CircularDDM)

###################
## dcddm example ##
###################
x <- cbind(
RT= c(1.2595272, 0.8693937, 0.8009044, 1.0018933, 2.3640007, 1.0521304),
R = c(1.9217430, 1.7844653, 0.2662521, 2.1569724, 1.7277440, 0.8607271)
)
pVec <- c(a=2.45, vx=1.5, vy=1.25, t0=.1, s=1)
dcddm(x, pVec)

###################
## rcddm example ##
###################
pVec <- c(a=2, vx=1.5, vy=1.25, t0=.25, s=1)
den  <- rcddm(1e3, pVec);
hist(den[,1], breaks = "fd", xlab="Response Time", main="Density")
hist(den[,3], breaks = "fd", xlab="Response Angle", main="Density")

Installation and Prerequisites

R package

## From github
devtools::install_github("TasCL/CircularDDM")
## From source: 
install.packages("CircularDDM_0.0.8.tar.gz", repos = NULL, type="source")

R package requires:

  • R (>= 3.0.2)
  • Rtools
  • Rcpp (>= 0.12.3)
  • RcppArmadillo (>= 0.6.700.6.0)

MATLAB toolbox

The installation for MATLAB is simply copying the files in 'matlab' folder to MATLAB toolbox folder. For example, in Linux default path, MATLAB toolbox is at '/usr/local/MATLAB/R2016a/toolbox' (version number may vary, e.g., 'R2015', etc.). The following is a step-by-step instruction.

  1. Create a folder (e.g., by issuing 'mkdir') called 'CircularDDM' under '/usr/local/MATLAB/R2016a/toolbox'
  2. Copy all files in the 'inst/matlab' in the source tar ball to '/usr/local/MATLAB/R2016a/toolbox/CircularDDM'. Entering 'matlabroot' in MATLAB prompt will show MATLAB root folder.
  3. Use a text editor to open /usr/local/MATLAB/R2016a/toolbox/local/pathdef.m. Note that pathdef.m might have not set a write flag. "chmod +w pathdef.m" will add write ('w') flag on the file.
  4. Add "matlabroot,'/toolbox/CircularDDM:', ..." before "%%% END ENTRIES %%%"
  5. Save and close the file.
  6. Enter the following three command in MATLAB prompt to test if CircularDDM package is installed properly.
help('rcircularddm')
help('dcircularddm')
help('rvonmises')

MATLAB package requires:

  • GNU gsl 1.16 (gsl requires CBLAS)
  • Armadillo ( >= 0.6.700.6.0)
  • Armadillo requires either (1) LAPACK and BLAS, (2) OpenBLAS or (3) Intel Math Kernel Library (MKL). I have not tested the third option. However Aramadillo's author recommends it as a perhaps even faster option.
  • See Armadillo C++ for details.

References

News

0.0.0.9 Yi-Shin Lin [email protected]

  • Correct the error of author's email address in CircularDDM.R

0.0.0.8 Yi-Shin Lin [email protected]

  • Correct author field error

0.0.0.7 Yi-Shin Lin [email protected]

  • First release to the public
  • Correct diffusion to Diffusion in title

Reference manual

It appears you don't have a PDF plugin for this browser. You can click here to download the reference manual.

install.packages("CircularDDM")

0.1.0 by Yi-Shin Lin, a year ago


Browse source code at https://github.com/cran/CircularDDM


Authors: Yi-Shin Lin [aut, cre] , Andrew Heathcote [aut] , Peter Kvam [aut]


Documentation:   PDF Manual  


GPL-2 license


Imports Rcpp

Linking to Rcpp, RcppArmadillo


See at CRAN