InvChisquare              package:geoR              R Documentation

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

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

     Density and random generation for the scaled inverse chi-squared
     (chi^2_{ScI}) distribution with 'df' degrees of freedom and
     optional non-centrality parameter 'scale'.

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

     dinvchisq(x, df, scale, log = FALSE)
     rinvchisq(n, df, scale = 1/df)

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

       x: vector of quantiles.

       n: number of observations. If 'length(n) > 1', the length is
          taken to be the number required.

      df: degrees of freedom.

   scale: scale parameter.

     log: logical; if TRUE, densities d are given as log(d).

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

     The inverse chi-squared distribution with 'df'= n degrees of
     freedom has density

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

     for x > 0. The mean and variance are 1/(n-2) and 2/((n-4)(n-2)^2).

     The non-central chi-squared distribution with 'df'= n degrees of
     freedom and non-centrality parameter 'scale' = S^2 has density

 f(x) = ((n/2)^(n/2))/(Gamma (n/2)) S^n (1/x)^((n/2)+1) e^(-(n S^2)/(2x))

     , for x >= 0. The first is a particular case of the latter for
     lambda = n/2.

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

     'dinvchisq' gives the density and 'rinvchisq' generates random
     deviates.

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

     'rchisq' for the chi-squared distribution which is the basis for
     this function.

_E_x_a_m_p_l_e_s:

     set.seed(1234); rinvchisq(5, df=2)
     set.seed(1234); 1/rchisq(5, df=2)

     set.seed(1234); rinvchisq(5, df=2, scale=5)
     set.seed(1234); 5*2/rchisq(5, df=2)

     ## inverse Chi-squared is a particular case
     x <- 1:10
     all.equal(dinvchisq(x, df=2), dinvchisq(x, df=2, scale=1/2))

