Learn R Programming

voigt (version 2.0)

Voigt: The Voigt Distribution

Description

Density function and random generation for the Voigt distribution with median equal to mu and scale parameters equal to sigma and gamma.

Usage

dvoigt(y, mu = 0, sigma = 1, gamma = 1, fast= TRUE)
rvoigt(n = 1, mu = 0, sigma = 1, gamma = 1)

Value

dvoigt gives the density and rvoigt generates random deviates.

Arguments

n

The size of the random sample.

y

Vector of quantiles.

mu

The median of the Voigt.

sigma

Voigt first scale parameter.

gamma

Voigt second scale parameter.

fast

If TRUE (default) the Voigt density is calculated via Kendall's expression; if FALSE via numerical integration (slower but extended tail coverage).

Author

tools:::Rd_package_author("voigt")

Details

The Voigt distribution is the convolution of a Normal and a Cauchy. The density function is $$ f(y)=\frac{\Re(w(z))}{\sigma \sqrt{2\pi}}, \quad \sigma,\gamma>0 $$ where \(w(z)=e^{-z^2}erfc(-iz)\) is the Faddeeva function, \(z=\frac{y-\mu +i\gamma}{\sigma\sqrt{2}}\), mu is the median, sigma is the standard deviation of the normal component and gamma is the scale parameter of the Cauchy component. If mu, sigma and gamma are not specified they assume the default values of 0, 1 and 1, respectively.

References

Kendall, D. G. (1938). The effect of radiation damping and Doppler broadening on the atomic absorption coefficient. Zeitschrift fur Astrophysik, Vol. 16, p.308 https://adsabs.harvard.edu/full/1938ZA.....16..308K

Abramowitz, M., and I. A. Stegun (1972). Handbook of Mathematical Functions (with Formulas, Graphs, and Mathematical Tables). Dover, New York. https://personal.math.ubc.ca/~cbm/aands/notes.htm

See Also

evoigt

Examples

Run this code
dvoigt(0)
# 0.2087093
# plot voigt and gaussian density
x = seq(from=-4,to=4, by=0.01)
plot(x, dvoigt(x), type="l",ylab="",ylim=c(0,0.8))
lines(x,dvoigt(x,0,1/3,1/3),col="blue")
lines(x,dnorm(x),lty=2, col="red")
mtext("dvoigt(x,0,1,1)", adj = 0,col="black")
mtext("dnorm(x)", adj = 1/2,col="red")
mtext("dvoigt(x,0,1/3,1/3)", adj = 1,col="blue")

# compare true and empirical density
rvoigt(1)
x = rvoigt(n=500)
q=quantile(x,0.99)
hist(x[x>-q & x-q & x-q & y

Run the code above in your browser using DataLab