constrppmn             package:polyapost             R Documentation

_E_s_t_i_m_a_t_i_n_g _a _p_o_p_u_l_a_t_i_o_n  _m_e_a_n _u_s_i_n_g _t_h_e _c_o_n_s_t_r_a_i_n_e_d _P_o_l_y_a _p_o_s_t_e_r_i_o_r.

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

     Let p=(p1,...,pn) be a probability distribution defined on ysamp,
     the set of observed values, in a sample of size n from some
     population. p is assumed to belong to a polytope which is a lower
     dimensional subset of the n-dimensional simplex. The polytope is
     defined by a collection of linear equality and inequality
     constraints. A dependent sequence of values for p are generated by
     a Markov chain using the Metropolis-Hastings algorithm whose
     stationary distribution is the uniform distribution over the
     polytope. For each generated value of p the corresponding mean,
     sum(pi*yi)  is found.

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

     constrppmn(A1,A2,A3,b1,b2,b3,initsol,reps,ysamp,burnin)

_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.

    reps: The total length of the chain that is generated.

   ysamp: The observed sample from the population of interest.

  burnin: The point in the chain at which the set of computed means
          begins.

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

     The returned value is a list whose first component is the chain of
     the means of length (reps - burnin -1), whose second component is
     the mean  of the first component (i.e. the Polya estimate of the
     population mean) and whose third component is the 2.5th and 97.5th
     quantiles of the first component (i.e. an approximate 95 percent
     confidence interval of the population mean).

_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))
     b1<-c(1,3.5)
     b2<-c(6,rep(0,6))
     initsol<-rep(1/6,6)
     rep<-1006
     burnin<-1000
     ysamp<-c(1,2.5,3.5,7,4.5,6)
     out<-constrppmn(A1,A2,NULL,b1,b2,NULL,initsol,rep,ysamp,burnin)
     out[[1]] # the Markov chain of the means.
     out[[2]] # the average of out[[1]]
     out[[3]] # the 2.5th and 97.5th quantiles of out[[1]]

