Chisquare                package:base                R Documentation

_T_h_e (_n_o_n-_c_e_n_t_r_a_l) _C_h_i-_S_q_u_a_r_e _D_i_s_t_r_i_b_u_t_i_o_n

_D_e_s_c_r_i_p_t_i_o_n:

     Density, distribution function, quantile function and random
     generation for the chi-square (chi^2) distribution with `df'
     degrees of freedom and optional non-centrality parameter `ncp'.

_U_s_a_g_e:

     dchisq(x, df, ncp=0, log = FALSE)
     pchisq(q, df, ncp=0, lower.tail = TRUE, log.p = FALSE)
     qchisq(p, df, ncp=0, lower.tail = TRUE, log.p = FALSE)
     rchisq(n, df)

_A_r_g_u_m_e_n_t_s:

    x, q: vector of quantiles.

       p: vector of probabilities.

       n: number of observations to generate.

      df: degrees of freedom.

     ncp: non-centrality parameter.

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

_D_e_t_a_i_l_s:

     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, respectively.

     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.

_V_a_l_u_e:

     `dchisq' gives the density, `pchisq' gives the distribution
     function, `qchisq' gives the quantile function, and `rchisq'
     generates random deviates.

_S_e_e _A_l_s_o:

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

_E_x_a_m_p_l_e_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))

