dcusp {cusp}R Documentation

Cobb's Cusp Distribution

Description

Functions for the cusp distribution.

Usage

dcusp(y, alpha, beta)
pcusp(y, alpha, beta)
qcusp(p, alpha, beta)
rcusp(n, alpha, beta) 

Arguments

y vector of quantiles
p vector of probabilities
n number of observations.
alpha normal/asymmetry factor value of cusp density
beta bifurcation/splitting factor value of cusp density

Details

The cusp distribution is defined by

f(y) = Psi exp(α y + β y^2/2 - y^4/4),

where Psi is the normalizing constant.

rcusp uses rejection sampling to generate samples.

qcusp implements binary search and is rather slow.

Value

dcusp gives the density function, pcusp gives the distribution function, qcusp gives the quantile function, and rcusp generates observations.

Author(s)

Raoul Grasman

References

See cusp-package

See Also

cusp-package

Examples

    # evaluate density and distribution
    dcusp(0,2,3)
    pcusp(0,2,3)
    pcusp(qcusp(0.125,2,3),2,3) # = 0.125
    
    # generate cusp variates
    rcusp(100, 2, 3) 
    
    # generate cusp variates for random normal and splitting factor values
    alpha = runif(20, -3, 3)
    beta =  runif(20, -3, 3)
    Vectorize(rcusp)(1, alpha, beta)

[Package cusp version 2.2 Index]