Davies (version 1.2-0)

Davies: The Davies distribution

Description

Density, distribution function, quantile function and random generation for the Davies distribution.

Usage

ddavies(x, params,log=FALSE)
 pdavies(x, params,log.p=FALSE,lower.tail=TRUE)
 qdavies(p, params,lower.tail=TRUE)
 rdavies(n, params)
ddavies.p(x,params,log=FALSE)

Arguments

x

quantile

p

vector of probabilities

n

number of observations. If length(n) > 1, the length is taken to be the number required

lower.tail

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

log,log.p

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

params

A three-member vector holding CC, _1lambda1 and _2lambda2

Value

Function ddavies() gives the density, pdavies() gives the distribution function, qdavies() gives the quantile function, and rdavies() generates random deviates.

Details

The Davies distribution is defined in terms of its quantile function: $$Cp^{\lambda_1}/(1-p)^{\lambda_2}$$

It does not have a closed-form probability density function or cumulative density function, so numerical solution is used.

Function ddavies.p() returns the density of the Davies function but as a function of the quantile.

References

R. K. S. Hankin and A. Lee 2006. “A new family of non-negative distributions” Australia and New Zealand Journal of Statistics, 48(1):67--78

See Also

Gld, fit.davies.p, least.squares, skewness

Examples

Run this code
# NOT RUN {
params <- c(10,0.1,0.1)
x <- seq(from=4,to=20,by=0.2)
p <- seq(from=1e-3,to=1-1e-3,len=50)

rdavies(n=5,params)
least.squares(rdavies(100,params))
plot(pdavies(x,params))


plot(p,qdavies(p,params))
plot(x,ddavies(x,params),type="b")

# }

Run the code above in your browser using DataLab