windowWDM: Find a vector of Wiener Diffusion Model parameters

View source: R/windowWDM.R

windowWDMR Documentation

Find a vector of Wiener Diffusion Model parameters

Description

Estimates a set of Wiener Diffusion Model parameters for a vector of formatted data. Estimation uses RWiener::wdm and data must be formatted as a 1-dimensional vector according the to RWiener package (i.e., RT * 2 * (boundary=='upper' - 0.5) ). Assumes that RTs are associated with equally-spaced and sorted timepoints (e.g., trials of a behavioral study). First fits a RWiener::wdm for the entire RT vector, and applies some of these parameters (NDT, bias, and possibly BS) to the entire RT vector. Next takes a set of windows, equally spaced and centered at windowSize/2, and estimates the DR (and possibly BS) for each window. Averages overlapping windows. Returns a data frame of estimated parameters, including 95% CI.

Usage

windowWDM(dat, windowSize = 20, fit_BS = FALSE)

Arguments

dat

Response time vector. Positive values indicates upper-boundary while negative values indicate lower-boundary.

windowSize

Total width of each window for estimating parameters.

fit_BS

Logical. If FALSE only drift rate is estimated, if TRUE both drift rate and boundary separation are estimated.

Examples

## Not run: 
dat <- (rnorm(200,.2,.05) + rexp(200,1 / .2))*sample(c(-1,1),200,replace=T)
    m_drY_bsN <- windowWDM(dat,fit_BS = F)
    m_drY_bsY <- windowWDM(dat,fit_BS = T)
    ACmisc::pairsplot(cbind(trialNum = 1:200, RT = abs(dat),m_drY_bsY[,1:6]))
    
## End(Not run)

akcochrane/ACmisc documentation built on Nov. 24, 2024, 11:22 a.m.