Triangle                package:VGAM                R Documentation

_T_h_e _T_r_i_a_n_g_l_e _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 Triangle distribution with parameter 'theta'.

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

     dtriangle(x, theta, lower=0, upper=1)
     ptriangle(q, theta, lower=0, upper=1)
     qtriangle(p, theta, lower=0, upper=1)
     rtriangle(n, theta, lower=0, upper=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.

   theta: the theta parameter which lies between 'lower' and 'upper'. 

lower, upper: lower and upper limits of the distribution. Must be
          finite. 

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

     See 'triangle', the 'VGAM' family function for estimating the
     parameter theta by maximum likelihood estimation.

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

     'dtriangle' gives the density, 'ptriangle' gives the distribution
     function, 'qtriangle' gives the quantile function, and 'rtriangle'
     generates random deviates.

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

     T. W. Yee

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

     'triangle'.

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

     ## Not run: 
     x = seq(-0.1, 1.1, by=0.01)
     theta = 0.75
     plot(x, dtriangle(x, theta=theta), type="l", col="blue", las=1,
          main="Blue is density, red is cumulative distribution function",
          sub="Purple lines are the 10,20,...,90 percentiles",
          ylim=c(0,2), ylab="")
     abline(h=0, col="blue", lty=2)
     lines(x, ptriangle(x, theta=theta), col="red")
     probs = seq(0.1, 0.9, by=0.1)
     Q = qtriangle(probs, theta=theta)
     lines(Q, dtriangle(Q, theta=theta), col="purple", lty=3, type="h")
     ptriangle(Q, theta=theta) - probs    # Should be all zero
     abline(h=probs, col="purple", lty=3)
     ## End(Not run)

