Kumar                  package:VGAM                  R Documentation

_T_h_e _K_u_m_a_r_a_s_w_a_m_y _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 Kumaraswamy distribution.

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

     dkumar(x, shape1, shape2, log=FALSE)
     pkumar(q, shape1, shape2)
     qkumar(p, shape1, shape2)
     rkumar(n, shape1, shape2)

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

    x, q: vector of quantiles.

       p: vector of probabilities.

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

shape1, shape2: positive shape parameters. 

     log: Logical. If 'log=TRUE' then the logarithm of the density is
          returned.

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

     See 'kumar', the 'VGAM' family function for estimating the
     parameters,  for the formula of the probability density function
     and other details.

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

     'dkumar' gives the density, 'pkumar' gives the distribution
     function, 'qkumar' gives the quantile function, and 'rkumar'
     generates random deviates.

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

     T. W. Yee

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

     'kumar'.

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

     ## Not run: 
     shape1 = 2; shape2 = 2; nn = 201; # shape1 = shape2 = 0.5;
     x = seq(0.0 , 1.00, len=nn)
     x = seq(-0.05, 1.05, len=nn)
     plot(x, dkumar(x, shape1, shape2), type="l", las=1, ylim=c(0,1.5),
          ylab=paste("fkumar(shape1=", shape1, ", shape2=", shape2, ")"),
          col="blue", cex.main=0.8,
          main="Blue is density, red is cumulative distribution function",
          sub="Purple lines are the 10,20,...,90 percentiles")
     lines(x, pkumar(x, shape1, shape2), col="red")
     probs = seq(0.1, 0.9, by=0.1)
     Q = qkumar(probs, shape1, shape2)
     lines(Q, dkumar(Q, shape1, shape2), col="purple", lty=3, type="h")
     lines(Q, pkumar(Q, shape1, shape2), col="purple", lty=3, type="h")
     abline(h=probs, col="purple", lty=3)
     max(abs(pkumar(Q, shape1, shape2) - probs)) # Should be 0
     ## End(Not run)

