trialWDM: Find by-trial Wiener Diffusion Model parameters

View source: R/trialWDM.R

trialWDMR Documentation

Find by-trial 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) ).

Usage

trialWDM(
  dat,
  fit_DR = T,
  fit_BS = T,
  fit_NDT = T,
  fit_Bias = F,
  winsorize = NA
)

Arguments

dat

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

fit_DR

Logical or numeric scalar. If TRUE then drift rate is estimated for each trial, if FALSE only the overall parameter is estimated, and if numeric then the parameter is fixed to that value.

fit_BS

Logical or numeric scalar. If TRUE then boundary separation is estimated for each trial, if FALSE only the overall parameter is estimated, and if numeric then the parameter is fixed to that value.

fit_NDT

Logical or numeric scalar. If TRUE then non-decision time is estimated for each trial, if FALSE only the overall parameter is estimated, and if numeric then the parameter is fixed to that value.

fit_Bias

Logical or numeric scalar. If TRUE then bias is estimated for each trial, if FALSE only the overall parameter is estimated, and if numeric then the parameter is fixed to that value.

winsorize

Optional numeric scalar. If supplied, then all univariate values greater than number of MAD from the median are changed to be instead that number of MAD from the median (using mad() defaults).

Examples

## Not run: 
dat <- (rnorm(200,.2,.05) + rexp(200,1 / .2))*sample(c(-1,1,1),200,replace=T)
    m <- trialWDM(dat)
    
    m2 <- trialWDM(dat, fit_NDT = F , winsorize = 2)
    
    
## End(Not run)

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