This repository contains R code for the implementation of different simulation methods for generating data from the Circular Drift-Diffusion Model (CDDM). The performance of each method is evaluated for both computational efficiency and statistical accuracy.
File cddm_fullReport.Rmd contains a brief description of the simulation methods explored, and the custom functions build for their implementation. The four simulation methods explored are:
- Direct Emulation: Approximates the underlying stochastic process through discrete time steps
- Rejection Sampling: Operates in a bounded bivariate space
- Metropolis-Hastings Algorithm: Uses a bivariate normal proposal distribution
- Probability Integral Transform: Applies probability integral transform using trapezoid integration
Each method generates paired angular choices (in radians) and response times (in seconds). They are evaluated on the basis of:
- Their execution time
- The difference between the mean angular choice generated and the true underlying drift direction used to generate the data.
- The difference between the empirical cumulative distribution function of the generated data and the theoretical cumulative distribution function approximated through numerical integration.
code/cddm: R code specific to the CDDMcode/ddm/: R code specific to the DDMcode/figures: R scripts for generating figurescode/general_functions: R functions for general usecode/tests: R scripts for testing the simulation methodsreferences/: References and citationstests/: Placeholder for analysis scripts
To ensure reproducibility, we provide a Docker container with all necessary R packages and dependencies.
- Install Docker on your system
- Clone this repository:
git clone git@github.com:Adrifelcha/cddm-simulationMethods.git- Move to the code directory:
cd cddm-simulation-methods- Build the Docker image:
docker build -t cddm-simulation-methods .- Run the container:
docker run -p 2222:22 cddm-simulation-methodsThis will start the container and expose the SSH service on port 2222.
- Connect to the container via SSH:
ssh -p 2222 root@localhostWhen prompted, write down the root password: adri93
Once connected to the container:
- All required R packages are pre-installed
- The code is available in the
/app/code/cddmdirectory - You can run R scripts and interact with the R environment