histprior             package:LearnBayes             R Documentation

_D_e_n_s_i_t_y _f_u_n_c_t_i_o_n _o_f _a _h_i_s_t_o_g_r_a_m _d_i_s_t_r_i_b_u_t_i_o_n

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

     Computes the density of a probability distribution defined on a
     set of equal-width intervals

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

     histprior(p,midpts,prob)

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

       p: vector of values for which density is to computed

  midpts: vector of midpoints of the intervals

    prob: vector of probabilities of the intervals

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

     vector of values of the probability density

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

     Jim Albert

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

     midpts=c(.1,.3,.5,.7,.9)
     prob=c(.2,.2,.4,.1,.1)
     p=seq(.01,.99,by=.01)
     plot(p,histprior(p,midpts,prob),type="l")

