Description Usage Arguments Details Value Author(s) Examples
Uniformly samples from a convex polytope given by linear equalities in the
parameters using a hit-and-run algorithm. Given constraints: Ax = b and
x ≥ 0 the algorithm finds a point on the interior of the constraints.
From there it picks a direction in the k-plane defined by Ax = b and
then calculates the maximum and minimum distances (tmin
and
tmax
) it can move in that direction. It picks a random
distance to travel between tmin
and tmax
and this is used as
the next point. This algorithm is useful because each sample is made in
constant time.
1 2 |
A |
Matrix of constraint coefficients, rows should correspond to each constraint. A must not have collinear rows |
b |
A vector corresponding to the right hand side of the constraints |
n |
The number of output vectors desired |
discard |
A burninlength, how many vectors should be discarded before recording |
skiplength |
Only 1 out of every 'skiplength' vectors will be recorded |
chains |
number of different chains, starting from different starting points |
verbose |
Give verbose output of how the function is progressing. |
achr |
Whether to use "accelerated convergence hit and run" algorithm proposed in paper: <Insert Kaufman, Smith citation>. "discard" will be used to collect presamples to estimate the expected value of the span. |
To find tmin
and tmax
, we must find the first component that becomes zero
when going in the negative or positive direction (t). We have that x_i + u_it = 0 or
t = =-\frac{x_i}{u_i}. We must find the minimum and maximum for positive and negative t, respectively, in i.
Once those bounds are found, a value of t is picked uniformly on the interval between tmin
and tmax
.
Gives back a list of matrices with 'n' columns corrresponding to n uniformly sampled solutions of Ax = b. The number of lists = "chains" variable. 'n' columns.
Mike Flynn mflynn210@gmail.com
1 2 3 4 5 6 7 8 9 10 11 12 |
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.