dinvG: The inverse-Gaussian Distribution

Description Usage Arguments Details Value Examples

Description

Density, distribution function, quantile function and random generation for the inverse-Gaussian distribution with mean = mu and standard deviation = mu^{3} / lambda. See Table 1 in Cousineau, Brown, & Heathcote (2004) for the equation. kappa assumes 0.

Usage

1
2
3
4
5
6
7
dinvG(x, mu = 1, lambda = 1, log = FALSE)

pinvG(q, mu = 1, lambda = 1, lower.tail = TRUE, log.p = FALSE)

qinvG(p, mu = 1, lambda = 1, lower.tail = TRUE, log.p = FALSE)

rinvG(n, mu = 1, lambda = 1)

Arguments

x, q

vector of quantiles.

mu

vector of mu parameters.

lambda

vector of lambda 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.

Details

The inverse-Gaussian is also known as the Wald distribution.

Value

dinvG gives the density. pinvG gives the distribtuion function, qinvG gives the quantile function, and rinvG generates random deviates. mu <= 0 or lambda <= 0 is an error.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
x <- seq(0, 1, length.out = 1024)
den <- cpda::dinvG(x, mu=.275, lambda=2)
plot(x, den, type = "l", lwd = 2)

## Use Table 3 in Cousineau, Brown, & Heathcote (2004) as an example
n <- 4096
sam <- cpda::rinvG(n, 275, 2000) + 725
hist(sam, freq = FALSE, breaks = "FD", main = "Wald Distribution", 
  xlab = "RT (ms)", ylab="Density")
  

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