dexG: The ex-Gaussian Distribution

Description Usage Arguments Value Examples

Description

Density, distribution function, quantile function and random generation for the ex-Gaussian distribution with mean = mu + tau and standard deviation = sigma^{2} + tau^{2}. See Table 1 in Cousineau, Brown, & Heathcote (2004) for the equation.

Usage

1
2
3
4
5
6
7
dexG(x, mu = 5, sigma = 1, tau = 1, log = FALSE)

pexG(q, mu = 5, sigma = 1, tau = 1, lower.tail = TRUE, log.p = FALSE)

qexG(p, mu = 5, sigma = 1, tau = 1, lower.tail = TRUE, log.p = FALSE)

rexG(n, mu = 5, sigma = 1, tau = 1)

Arguments

x, q

vector of quantiles.

mu

vector of mu parameters.

sigma

vector of sigma parameters.

tau

vector of tau parameters.

log, log.p

logical; if TRUE, probabilities p are given as log(p)

lower.tail

logical; if TRUE, (default), probabilities are P[X ≤ x] otherwise, P[X > x].

p

vector of probabilities.

n

number of observations.

Value

dexG gives the density. pexG gives the distribtuion function, qexG gives the quantile function, and rexG generates random deviates. sigma < 0 or tau < 0 is an error.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
x <- seq(100, 600, length.out = 1024)
den <- cpda::dexG(x, mu=300, sigma=35, tau=100)

## Use Table 3 in Cousineau, Brown, & Heathcote (2004) as an example
n <- 1024
mu <- 910.56
sigma <- 44.721
tau <- 89.443
sam <- cpda::rexG(n, mu, sigma, tau)
hist(sam, freq = FALSE, breaks = "FD", main = "ex-Gaussian Distribution", 
  xlab = "RT (ms)", ylab="Density")
  

TasCL/cpda documentation built on May 3, 2019, 11:48 p.m.