
Last chance! 50% off unlimited learning
Sale ends in
Density, distribution function and random generation for the inverse chi-squared distribution and scaled chi-squared distribution.
dinvchisq(x, nu, tau, log = FALSE)pinvchisq(q, nu, tau, lower.tail = TRUE, log.p = FALSE)
qinvchisq(p, nu, tau, lower.tail = TRUE, log.p = FALSE)
rinvchisq(n, nu, tau)
vector of quantiles.
positive valued shape parameter.
positive valued scaling parameter; if provided it returns values for scaled chi-squared distributions.
logical; if TRUE, probabilities p are given as log(p).
logical; if TRUE (default), probabilities are
vector of probabilities.
number of observations. If length(n) > 1
,
the length is taken to be the number required.
If
x <- rinvchisq(1e5, 20)
hist(x, 100, freq = FALSE)
curve(dinvchisq(x, 20), 0, 1, n = 501, col = "red", add = TRUE)
hist(pinvchisq(x, 20))
plot(ecdf(x))
curve(pinvchisq(x, 20), 0, 1, n = 501, col = "red", lwd = 2, add = TRUE)
# scaled
x <- rinvchisq(1e5, 10, 5)
hist(x, 100, freq = FALSE)
curve(dinvchisq(x, 10, 5), 0, 150, n = 501, col = "red", add = TRUE)
hist(pinvchisq(x, 10, 5))
plot(ecdf(x))
curve(pinvchisq(x, 10, 5), 0, 150, n = 501, col = "red", lwd = 2, add = TRUE)
Run the code above in your browser using DataLab