U-utils | R Documentation |
Density, distribution function, quantile function and random number
generation for the shifted and scaled U of the
(location-)scale family input X \sim F_X(x \mid \boldsymbol \beta)
- see References.
Since the normalized random variable U is one of the main building blocks of
Lambert W \times
F distributions, these functions are wrappers used
by other functions such as dLambertW
or
rLambertW
.
dU(u, beta, distname, use.mean.variance = TRUE)
pU(u, beta, distname, use.mean.variance = TRUE)
qU(p, beta, distname, use.mean.variance = TRUE)
rU(n, beta, distname, use.mean.variance = TRUE)
u |
vector of quantiles. |
beta |
numeric vector (deprecated); parameter |
distname |
character; name of input distribution; see
|
use.mean.variance |
logical; if |
p |
vector of probability levels |
n |
number of samples |
dU
evaluates the pdf at y
, pU
evaluates the
cdf, qU
is the quantile function, and rU
generates random
samples from U.
# a zero-mean, unit variance version of the t_3 distribution.
curve(dU(x, beta = c(1, 1, 3), distname = "t"), -4, 4,
ylab = "pdf", xlab = "u",
main = "student-t \n zero-mean, unit variance")
# cdf of unit-variance version of an exp(3) -> just an exp(1)
curve(pU(x, beta = 3, distname = "exp"), 0, 4, ylab = "cdf", xlab = "u",
main = "Exponential \n unit variance", col = 2, lwd = 2)
curve(pexp(x, rate = 1), 0, 4, add = TRUE, lty = 2)
# all have (empirical) variance 1
var(rU(n = 1000, distname = "chisq", beta = 2))
var(rU(n = 1000, distname = "normal", beta = c(3, 3)))
var(rU(n = 1000, distname = "exp", beta = 1))
var(rU(n = 1000, distname = "unif", beta = c(0, 10)))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.