pnorMix               package:nor1mix               R Documentation

_N_o_r_m_a_l _M_i_x_t_u_r_e _C_u_m_u_l_a_t_i_v_e _D_i_s_t_r_i_b_u_t_i_o_n _a_n_d _Q_u_a_n_t_i_l_e_s

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

     Compute cumulative probabilities or quantiles (the inverse) for a
     normal mixture specified as 'norMix' object.

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

     pnorMix(obj, q)
     qnorMix(obj, p)

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

     obj: an object of class 'norMix'.

       p: numeric vector of probabilities.

       q: numeric vector of quantiles

     .

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

     Whereas the distribution function 'pnorMix' is the trivial sum of
     weighted normal probabilities ('pnorm'), its inverse is currently
     computed numerically using 'uniroot' to find 'q' such that
     'pnorMix(obj, q) == p'.

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

     a numeric vector of the same length as 'p' or 'q', respectively.

_A_u_t_h_o_r(_s):

     First version by Erik Jrgensen Erik.Jorgensen@agrsci.dk.

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

     'dnorMix' for the density function.

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

     MW.nm3 # the "strange skew" one
     plot(MW.nm3)
     ## now the cumlative :
     x <- seq(-4,4, length=1001)
     plot(x, pnorMix(MW.nm3, x), type="l", col=2)
     ## and some of its inverse :
     pp <- seq(.1, .9, by=.1)
     plot(qnorMix(MW.nm3, pp), pp)

     ## The "true" median of a normal mixture:
     median.norMix <- function(x) qnorMix(x, 1/2)
     median.norMix(MW.nm3) ## -2.32

