Given Ax = b,
walkr samples points from the intersection of
Ax = b with the n-simplex (∑ x = 1, x_i ≥ 0). The
Ax = b must be underdetermined, otherwise there is an unique solution
and there will be no sampling.
is the lhs of the matrix equation A
is the rhs of the matrix equation b
is the number of points we want to sample
is the MCMC sampling method. Please enter "hit-and-run", "dikin", or " optimized-dikin"
every thin-th point is stored
the first burn points are deleted
is the number of chains we run
is the format in which walkr returns the answer. Please enter "list" (of chains) or "matrix".
walkr package samples points using MCMC random walks from the
intersection of the N-Simplex with M hyperplanes. Mathematically
speaking, the sampling space is all vectors x that satisfy
Ax = b, ∑ x = 1, and x_i ≥ 0. The sampling
algorithms implemented are hit-and-run and Dikin Walk.
provides tools to examine and visualize the convergence properties of the
The main function of the package is
walkr. The user specifies A and
b in Ax = b, and the
walkr function samples points
from the complete solution to Ax=b intersected with the N-simplex.
The user can choose either
"hit-and-run" as the
sampling method, and the function also provides other MCMC parameters
such as thinning and burning.
Before the sampling, walkr internally performs the affine transformation
which takes the complete solution of Ax = b and that intersected
with the unit simplex into a space parametrized by coefficients, which
we call the "alpha-space". The specific set of procedures taken is
written in detail in the vignette. Essentially, the space is transformed,
the sampling takes place in the transformed space, and in the end
walkr transforms back into the original coordinate system
and returns the result. This transformation is affine, so the uniformity
and mixing properties of the MCMC algorithms are not affected.
The current MCMC sampling methods supported are "hit-and-run",
"dikin" and "optimized-dikin" (a Rcpp boosted version for speed).
1) Hit-and-run is computationally less expensive and also guarantees uniformity asympotically with complexity of O(n^3) points with respect to dimension n. However, in real practice, as dimensions ramp up, the mixing of hit-and-run is poor compared to Dikin. Thus, a lot of thinning would be needed as dimension ramps up.
2) Dikin Walk is a nearly uniform method known for its very strong mixing properties. However, each Dikin step is much more computationally expensive than hit-and-run, so it takes more time to sample every point. Thus, the "dikin" method uses RcppEigen to speed up the core computationally expensive operations in the algorithm.
Either a list of chains (with each chain as a matrix of points) or a matrix containing all the points. Each column is a point sampled.
1 2 3 4 5
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.