constrppprob: Dependent Sampling from the Uniform Distribution on a Polytope.
Description
Let \(p=(p_1,\ldots,p_n)\)
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.
Usage
constrppprob(A1,A2,A3,b1,b2,b3,initsol,step,k)
Value
The returned value is a \(k\) by \(n\) matrix of probability vectors.
Arguments
A1
The matrix for the equality constraints.This must always
contain the constraint sum(p) == 1.
A2
The matrix for the <= inequality constraints. This must always
contain the constraints -p <= 0.
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.