Description Usage Arguments Details See Also Examples
Density, distribution function, quantile function and random generation for the inverse chi-squared distribution.
1 2 3 4 5 6 7 |
x, q |
vector of quantiles. |
df |
degrees of freedom (non-negative, but can be non-integer). |
ncp |
non-centrality parameter (non-negative). |
log, log.p |
logical; if TRUE, probabilities p are given as log(p). |
lower.tail |
logical; if TRUE (default), probabilities are P[X <= x] otherwise, P[X > x]. |
p |
vector of probabilities. |
n |
number of observations. If length(n) > 1, the length is taken to be the number required. |
The functions (d/p/q/r)invchisq simply wrap those of the standard
(d/p/q/r)chisq R implementation, so look at, say,
dchisq
for details.
dchisq
; these functions just wrap the
(d/p/q/r)chisq functions.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 | s <- seq(0, 3, .01)
plot(s, dinvchisq(s, 3), type = 'l')
f <- function(x) dinvchisq(x, 3)
q <- 2
integrate(f, 0, q)
(p <- pinvchisq(q, 3))
qinvchisq(p, 3) # = q
mean(rinvchisq(1e5, 3) <= q)
f <- function(x) dinvchisq(x, 3, ncp = 2)
q <- 1.5
integrate(f, 0, q)
(p <- pinvchisq(q, 3, ncp = 2))
qinvchisq(p, 3, ncp = 2) # = q
mean(rinvchisq(1e7, 3, ncp = 2) <= q)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.