argus-package {argus} | R Documentation |
Generator and density for the Argus distribution
Description
Random variate generation, density, CDF and quantile function for the Argus distribution. Especially, it includes for random variate generation a flexible inversion method that is also fast in the varying parameter case. A Ratio-of-Uniforms method is provided as second alternative.
Details
The Argus distribution has the density (pdf) which is proportional to
f(x) = x \sqrt{1-x^2}\exp(-0.5\chi^2(1-x^2)), \mbox{for} 0 \leq x \leq 1 \mbox{and} \chi > 0
Package: | argus |
License: | GPL 2 or later |
Package argus provides the routines:
rargus
generates argus distributed random variates.
dargus
computes the density of the argus distribution.
pargus
computes the CDF of the argus distribution.
qargus
computes the quantile function (ie. the inverse CDF )of the argus distribution.
Author(s)
Wolfgang Hörmann & Christoph Baumgarten
References
Christoph Baumgarten: Random Variate Generation by Fast Numerical Inversion in the Varying Parameter Case.
Examples
## Evaluate the pdf (density)
dargus(c(0.1,0.5,0.9), chi=0.3)
## Evaluate the CDF for different chi values
pargus(c(0.1,0.5,0.9), chi=c(0.3,1.3,2.3))
## Evaluate the quantile function
pargus(c(0.1,0.5,0.9), chi=4.5)
## Draw a random sample
rargus(n=10, chi=0.3)
## compare histogram and density
system.time(y<-rargus(1.e5,chi=2.5))
hist(y,breaks=100,freq=FALSE)
lines(x<-seq(0,1,1.e-3),dargus(x,2.5),col=2,lwd=2)