Bisa                  package:VGAM                  R Documentation

_T_h_e _B_i_r_n_b_a_u_m-_S_a_u_n_d_e_r_s _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, and random generation for the
     Birnbaum-Saunders distribution.

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

     dbisa(x, shape, scale=1, log=FALSE)
     pbisa(q, shape, scale=1)
     qbisa(p, shape, scale=1)
     rbisa(n, shape, scale=1)

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

    x, q: vector of quantiles.

       p: vector of probabilities.

       n: number of observations. Must be a positive integer of length
          1.

shape, scale: the (positive) shape and scale parameters.

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

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

     The Birnbaum-Saunders distribution is a distribution which is used
     in survival analysis. See 'bisa', the 'VGAM' family function for
     estimating the parameters,  for more details.

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

     'dbisa' gives the density, 'pbisa' gives the distribution
     function, and 'qbisa' gives the quantile function, and 'rbisa'
     generates random deviates.

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

     T. W. Yee

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

     'bisa'.

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

     ## Not run: 
     x = seq(0, 6, len=400)
     plot(x, dbisa(x, shape=1), type="l", col="blue", ylab="Density", lwd=2,
          main="X ~ Birnbaum-Saunders(shape, scale=1)", ylim=c(0,1.3), lty=3)
     lines(x, dbisa(x, shape=2), col="red", lty=2, lwd=2)
     lines(x, dbisa(x, shape=0.5), col="green", lty=1, lwd=2)
     legend(x=3, y=0.9, legend=paste("shape =",c(0.5,1,2)),
            col=c("green","blue","red"), lty=1:3, lwd=2)

     shape = 1
     x = seq(0.0, 4, len=401)
     plot(x, dbisa(x, shape=shape), type="l", col="blue", las=1, ylab="",
          main="Blue is density, red is cumulative distribution function",
          sub="Purple lines are the 10,20,...,90 percentiles", ylim=0:1)
     abline(h=0, col="blue", lty=2)
     lines(x, pbisa(x, shape=shape), col="red")
     probs = seq(0.1, 0.9, by=0.1)
     Q = qbisa(probs, shape=shape)
     lines(Q, dbisa(Q, shape=shape), col="purple", lty=3, type="h")
     pbisa(Q, shape=shape) - probs    # Should be all zero
     abline(h=probs, col="purple", lty=3)
     lines(Q, pbisa(Q, shape), col="purple", lty=3, type="h")
     ## End(Not run)

