Skip to contents

Vaughan's standardised family (mean 0, variance 1) with density f(z) = c1 exp(c2 z) / (exp(2 c2 z) + 2 a exp(c2 z) + 1), x = loc + scale z. For -pi < t < 0: a = cos t, c2 = sqrt((pi^2 - t^2)/3), c1 = sin(t)/t c2; t = 0 is the logistic; for t > 0 cosh and sinh replace cos and sin and pi^2 + t^2 replaces pi^2 - t^2. The distribution function and quantile are closed form.

Usage

GHSecant(x = NULL, t = 0, loc = 0, scale = 1, p = NULL, n = 0, seed = 0)

Arguments

x

Points for pdf, logpdf and cdf.

t

Shape, t > -pi; t = -pi/2 is the hyperbolic secant distribution.

loc, scale

Location and scale.

p

Probabilities for the quantile.

n

Number of draws (Philox stream, matches the Python arm).

seed

Seed.

Value

list with pdf, logpdf, cdf, quantile, random as requested.

References

Vaughan, D. C. (2002). The generalized secant hyperbolic distribution and its properties. Communications in Statistics - Theory and Methods 31, 219-238.

Examples

GHSecant(c(-1, 0, 1), t = -pi / 2)$pdf
#> [1] 0.1992684 0.5000000 0.1992684