Skip to content

A minimal demo of how to do multilevel regression using an ExGaussian distribution

License

Notifications You must be signed in to change notification settings

lawsofthought/exgaussml

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Multilevel Ex-Gaussian Model for Response Times

This is a minimal example, using artificial data, of how to model human response times using a multilevel ExGaussian regression model. It is implemented in Jags and R and uses the gamlss and rjags packages. For details about how to see up R to use Jags, see a guide I wrote for a workshop that I teach that requires R to use Jags.

Details

An ExGaussian probability distribution with parameters \mu, \sigma^2, and \tau:, is a convolution of a Gaussian (or Normal) distribution with mean and variance parameters \mu, \sigma^2 respectively, and an exponential distribution with rate parameter \tau. More simply, if x is normally distributed random variable, with parameters \mu, \sigma^2, and y is an exponentially distributed with parameters \tau, then

z = x + y

is an ExGaussian random variable with parameters \mu, \sigma^2 and \tau.

The ExGaussian distribution has been used a model of human reaction times, see [Hea1991]. As such, it could be used to replace the Normal probability distribution that is the standard assumption of linear regresion models. What follows is a description of how to do this in a multilevel regression model, where the slope and intercepts for some predictor vary randomly across subjects in an experiment. Also, both \mu and \tau vary as (linear or transformed linear) functions of the predictor.

In detail, let us assume that our observed data are

(z_i, v_i, s_i)

for i \in 1 \ldots n, where z_i is the observed response time on trial i, v_i is the value of the predictor variable on trial i, and s_i \in 1 \ldots K is the identity of the subject on trial i.

The main details of this model are as follows:

z_i &\sim \mathrm{dexgauss}(\mu_i, \tau_i, \sigma^2) \\
\mu_i &= \alpha_{0[s_i]} + \beta_{0[s_i]} v_i, \\
\log(\tau_i) &= \alpha_{1[s_i]} + \beta_{1[s_i]} v_i,

where, for k \in 1 \ldots K, each of \alpha_{0k}, \beta_{0k}, \alpha_{1k}, \beta{1k} are normally distributed random variables. These are random slopes and intercepts for each subject.

[Hea1991]Analysis of response time distributions: An example using the Stroop task. Heathcote, Andrew; Popiel, Stephen J.; Mewhort, D. J. Psychological Bulletin, Vol 109(2), Mar 1991, 340-347.

About

A minimal demo of how to do multilevel regression using an ExGaussian distribution

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages