constrppprob            package:polyapost            R Documentation

_D_e_p_e_n_d_e_n_t _s_a_m_p_l_i_n_g _f_r_o_m _t_h_e _u_n_i_f_r_o_m _d_i_s_t_r_i_b_u_t_i_o_n _o_n
_a _p_o_l_y_t_o_p_e.

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

     Let p=(p1,...,pn) be a probability distribution  which belongs to
     a lower dimensional polytope of the n-dimensional simplex. The
     polytope is defined by a collection of linear equality and
     inequality constraints. A dependent sequence of the  p's are
     generated by a Markov chain using the Metropolis-Hastings
     algorithm whose stationary distribution is the uniform
     distribution over the polytope. This is done by generating k
     blocks of size step where the last member of each is returned.

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

     constrppprob(A1,A2,A3,b1,b2,b3,initsol,step,k)

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

      A1: The matrix for the equality constraints.This must always
          contain the constraint that the sum of the pi's is one.

      A2: The matrix for the <= inequality constraints. This must
          always contain the constraints -pi <= 0, i.e. that the pi's
          must be nonnegative.

      A3: The matrix for the >= inequality constraints. If there are no
          such constraints A3 must be set equal to NULL.

      b1: The rhs vector for A1, each component must be nonnegative.

      b2: The rhs vector for A2, each component must be nonnegative.

      b3: The rhs vector for A3, each component must be nonnegative. If
          A3 is NULL then b3 must be NULL.

 initsol: A vector which lies in the interior of the polytope.

    step: The number of p's generated in a block before the last member
          of a block is returned.

       k: The total number of blocks generated and hence the number of
          p's returned.

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

     The returned value is a k by n matrix  of probability vectors.

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

     A1<-rbind(rep(1,6),1:6)
     A2<-rbind(c(2,5,7,1,10,8),diag(-1,6))
     A3<-matrix(c(1,1,1,0,0,0),1,6)
     b1<-c(1,3.5)
     b2<-c(6,rep(0,6))
     b3<-0.45
     initsol<-rep(1/6,6)
     constrppprob(A1,A2,A3,b1,b2,b3,initsol,2000,5)

