# invchi: The Inverse Chi Distribution In chi: The Chi Distribution

## Description

Density, distribution function, quantile function and random generation for the inverse chi distribution.

## Usage

 ```1 2 3 4 5 6 7``` ```dinvchi(x, df, ncp = 0, log = FALSE) pinvchi(q, df, ncp = 0, lower.tail = TRUE, log.p = FALSE) qinvchi(p, df, ncp = 0, lower.tail = TRUE, log.p = FALSE) rinvchi(n, df, ncp = 0) ```

## Arguments

 `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.

`dchi`

## Examples

 ``` 1 2 3 4 5 6 7 8 9 10 11 12 13 14``` ```s <- seq(0, 2, .01) plot(s, dinvchi(s, 7), type = 'l') f <- function(x) dinvchi(x, 7) q <- .5 integrate(f, 0, q) (p <- pinvchi(q, 7)) qinvchi(p, 7) # = q mean(rinvchi(1e5, 7) <= q) samples <- rinvchi(1e5, 7) plot(density(samples)) curve(f, add = TRUE, col = "red") ```

chi documentation built on May 30, 2017, 5:19 a.m.