Learn R Programming

VGAM (version 1.0-2)

tikuv: A Short-tailed Symmetric Distribution

Description

Density, cumulative distribution function, quantile function and random generation for the short-tailed symmetric distribution of Tiku and Vaughan (1999).

Usage

dtikuv(x, d, mean = 0, sigma = 1, log = FALSE) ptikuv(q, d, mean = 0, sigma = 1, lower.tail = TRUE, log.p = FALSE) qtikuv(p, d, mean = 0, sigma = 1, lower.tail = TRUE, log.p = FALSE, ...) rtikuv(n, d, mean = 0, sigma = 1, Smallno = 1.0e-6)

Arguments

d
The $d$ parameter. It must be a single numeric value less than 2. Then $h = 2-d>0$ is another parameter.

lmean, lsigma
Link functions for the mean and standard deviation parameters of the usual univariate normal distribution (see Details below). They are $mu$ and $sigma$ respectively. See Links for more choices.

isigma
Optional initial value for $sigma$. A NULL means a value is computed internally.

zero
A vector specifying which linear/additive predictors are modelled as intercept-only. The values can be from the set {1,2}, corresponding respectively to $mu$, $sigma$. If zero = NULL then all linear/additive predictors are modelled as a linear combination of the explanatory variables. For many data sets having zero = 2 is a good idea. See CommonVGAMffArguments for information.

x, q
vector of quantiles.
p
vector of probabilities.
n
number of observations. Same as in runif.

d, mean, sigma
arguments for the parameters of the distribution. See tikuv for more details. For rtikuv, arguments mean and sigma must be of length 1.

Smallno
Numeric, a small value used by the rejection method for determining the lower and upper limits of the distribution. That is, ptikuv(L) < Smallno and ptikuv(U) > 1-Smallno where L and U are the lower and upper limits respectively.

...
Arguments that can be passed into uniroot.

log
Logical. If log = TRUE then the logarithm of the density is returned.

lower.tail, log.p
Same meaning as in pnorm or qnorm.

Value

dtikuv gives the density, ptikuv gives the cumulative distribution function, qtikuv gives the quantile function, and rtikuv generates random deviates.

Warning

Under- or over-flow may occur if the data is ill-conditioned, e.g., when $d$ is very close to 2 or approaches -Inf.

Details

See tikuv for more details.

See Also

tikuv.

Examples

Run this code
## Not run:  par(mfrow = c(2, 1))
# x <- seq(-5, 5, len = 401)
# plot(x, dnorm(x), type = "l", col = "black", ylab = "", las = 1,
#      main = "Black is standard normal, others are dtikuv(x, d)")
# lines(x, dtikuv(x, d = -10), col = "orange")
# lines(x, dtikuv(x, d = -1 ), col = "blue")
# lines(x, dtikuv(x, d =  1 ), col = "green")
# legend("topleft", col = c("orange","blue","green"), lty = rep(1, len = 3),
#        legend = paste("d =", c(-10, -1, 1)))
# 
# plot(x, pnorm(x), type = "l", col = "black", ylab = "", las = 1,
#      main = "Black is standard normal, others are ptikuv(x, d)")
# lines(x, ptikuv(x, d = -10), col = "orange")
# lines(x, ptikuv(x, d = -1 ), col = "blue")
# lines(x, ptikuv(x, d =  1 ), col = "green")
# legend("topleft", col = c("orange","blue","green"), lty = rep(1, len = 3),
#        legend = paste("d =", c(-10, -1, 1))) ## End(Not run)

probs <- seq(0.1, 0.9, by = 0.1)
ptikuv(qtikuv(p = probs, d =  1), d = 1) - probs  # Should be all 0

Run the code above in your browser using DataLab