Betanorm                package:VGAM                R Documentation

_T_h_e _B_e_t_a-_N_o_r_m_a_l _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 univariate beta-normal distribution.

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

     dbetanorm(x, shape1, shape2, mean=0, sd=1, log.arg=FALSE)
     pbetanorm(q, shape1, shape2, mean=0, sd=1, lower.tail=TRUE, log.p=FALSE)
     qbetanorm(p, shape1, shape2, mean=0, sd=1)
     rbetanorm(n, shape1, shape2, mean=0, sd=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.

shape1, shape2: the two (positive) shape parameters of the standard
          beta distribution. They are called 'a' and 'b' in 'beta'.

mean, sd: the mean and standard deviation of the univariate normal
          distribution.

log.arg, log.p: Logical. If 'TRUE' then all probabilities 'p' are given
          as 'log(p)'.

lower.tail: Logical. If 'TRUE' then the upper tail is returned, i.e.,
          one minus the usual answer.

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

     The function 'betanormal1', the 'VGAM' family function for
     estimating the parameters,  has not yet been written.

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

     'dbetanorm' gives the density, 'pbetanorm' gives the distribution
     function, 'qbetanorm' gives the quantile function, and 'rbetanorm'
     generates random deviates.

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

     T. W. Yee

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

     ## Not run: 
     shape1 = 0.1; shape2 = 4; m = 1
     x = seq(-10, 2, len=501)
     plot(x, dbetanorm(x, shape1, shape2, m=m), type="l", ylim=0:1, las=1,
          ylab=paste("betanorm(",shape1,", ",shape2,", m=",m, ", sd=1)", sep=""),
          main="Blue is density, red is cumulative distribution function",
          sub="Purple lines are the 10,20,...,90 percentiles", col="blue")
     lines(x, pbetanorm(x, shape1, shape2, m=m), col="red")
     abline(h=0)
     probs = seq(0.1, 0.9, by=0.1)
     Q = qbetanorm(probs, shape1, shape2, m=m)
     lines(Q, dbetanorm(Q, shape1, shape2, m=m), col="purple",
           lty=3, type="h")
     lines(Q, pbetanorm(Q, shape1, shape2, m=m), col="purple", lty=3, type="h")
     abline(h=probs, col="purple", lty=3)
     pbetanorm(Q, shape1, shape2, m=m) - probs # Should be all 0
     ## End(Not run)

