# dcddm: The Circular Drift-diffusion Distribution In CircularDDM: Circular Drift-Diffusion Model

## Description

Density function and random generation for the circular drift-diffusion model with theta vector equal to `pVec`. `dcddm` is the equation (23) on page 433 in Smith (2016).

## Usage

 ```1 2 3``` ```dcddm(x, pVec, k = 141L) rcddm(n, pVec, p = 0.15) ```

## Arguments

 `x` a matrix storing a first column as RT and a second column of continuous responses/reports/outcomes. Each row is a trial. `pVec` a parameter vector with the order [a, vx, vy, t0, s], or [thresh, mu1, mu2, ndt, sigmasq]. The order matters. `k` a precision for calculating the infinite series in `dcddm`. The larger the k is, the larger the memory space is required. Default is 141. `n` number of observations. `p` a precision for random walk step in `rcddm`. Default is 0.15 second

## Value

`dcddm` gives a log-likelihood vector. `rddm` generates random deviates, returning a n x 3 matrix with the columns: RTs, choices and then angles.

## References

Smith, P. L. (2016). Diffusion Theory of Decision Making in Continuous Report, Psychological Review, 123 (4), 425–451.

## Examples

 ``` 1 2 3 4 5 6 7 8 9 10 11 12 13``` ```## 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") ```

### Example output

```           [,1]
[1,] -1.7925136
[2,] -0.9038642
[3,]  1.1758415
[4,] -2.6084263
[5,] -3.2489231
[6,]  1.5580843
```

CircularDDM documentation built on May 2, 2019, 2:07 a.m.