

   Chisquare {base}                             R Documentation

   TThhee ((nnoonn--cceennttrraall)) CChhii--SSqquuaarree DDiissttrriibbuuttiioonn

   UUssaaggee::

        dchisq(x, df, ncp=0)
        pchisq(q, df, ncp=0)
        qchisq(p, df, ncp=0)
        rchisq(n, df)

   AArrgguummeennttss::

        x,q: vector of quantiles.

          p: vector of probabilities.

          n: number of observations to generate.

         df: degrees of freedom.

        ncp: non-centrality parameter.

   VVaalluuee::

        These functions provide information about the chi-
        square (chi^2) distribution with `df' degrees of free-
        dom and optional non-centrality parameter `ncp'.

        The chi-square distribution with `df'= n degrees of
        freedom has density

         f_n(x) = 1 / (2^(n/2) Gamma(n/2))  x^(n/2-1) e^(-x/2)

        for x > 0. Mean and variance are n and 2n, respec-
        tively.

        `dchisq' gives the density f_n, `pchisq' gives the dis-
        tribution function F_n, `qchisq' gives the quantile
        function and `rchisq' generates random deviates.

        The non-central chi-square distribution with `df'= n
        degrees of freedom and non-centrality parameter `ncp' =
        lambda has density

        f(x) = exp(-lambda/2) SUM_{r=0}^infty ((lambda/2)^r / r!) dchisq(x, df + 2r)

        for x >= 0.

   SSeeee AAllssoo::

        `dgamma' for the gamma distribution which generalizes
        the chi-square one.

   EExxaammpplleess::

        dchisq(1, df=1:3)
        pchisq(1, df= 3)
        pchisq(1, df= 3, ncp = 0:4)# includes the above

        x <- 1:10
        ## Chisquare( df = 2) is a special exponential distribution
        all.equal(dchisq(x, df=2), dexp(x, 1/2))
        all.equal(pchisq(x, df=2), pexp(x, 1/2))

