Xsampler: Z-polytope sampler for linear inverse problems

XsamplerR Documentation

Z-polytope sampler for linear inverse problems

Description

For the linear inverse problem y=Ax where y and x are counts, the y-fibre (solution set) is a Z-polytope (i.e. the points on the integer lattice within a convex polytope). This function implements samplers for the Z-polytope, with using a dynamic lattice basis or a full Markov basis. The underyling model for x can be Poisson, uniform or negative binomial.

Usage

Xsampler(
  y,
  A,
  lambda,
  U = NULL,
  Method = "MH",
  Reorder = TRUE,
  tune.par = 0.5,
  combine = FALSE,
  x.order = NULL,
  x.ini = NULL,
  Model = "Poisson",
  Proposal = "Unif",
  NB.alpha = 1,
  ndraws = 10000,
  burnin = 2000,
  verbose = 0,
  THIN = 1
)

Arguments

y

Vector of observed count data.

A

Model configuration matrix, assumed to be binary.

lambda

Mean vector for x.

U

Optional matrix the columns of which should be a Markov (sub)-basis.

Method

"MH" for Metropolis-Hastings sampler, "Gibbs" for Gibbs sampler.

Reorder

Should the columns of A be reordered? Defaults to TRUE.

tune.par

Tuning parameter (alpha) controlling variation in fitness values for lattice bases. Defaults to 0.5.

combine

Should extra moves be included combining lattice basis vectors? Defaults to FALSE, but should usually be set to TRUE if A is not unimodular.

x.order

If Reorder=FALSE, x.order can be used to reorder columns of A to match ordering of entries of x. Defaults to NULL when no such reordering is performed.

x.ini

Vector of initial values for x. Default is NULL, when initial values derived through integer programming.

Model

"Poisson", "Uniform", "NegBin" or "Normal" (the last being a discrete approximation).

Proposal

"NonUnif" or "Unif" (default).

NB.alpha

Dispersion parameter for negaqtive-binomial distribution. Defaults to 1.

ndraws

Number of iterations to run sampler after burn-in. One iteration comprises cycling through the full basis (possibly augmented by a combined move). Defaults to 10^4.

burnin

Number of iteractions for burn in period. Defaults to 2000, which is usually more than adequate.

verbose

Controls level of detail in recording lattice bases used.

THIN

Thinning parameter for output. Defaults to 1 (no thinning).

Value

A list with components X (a matrix, each row corresponding to samplers for an entry of x) and x.order (a vector describing dynamic selection of lattice bases, if verbose=1).

Examples

data(LondonRoad)
Xsampler(A=LondonRoad$A,y=LondonRoad$y,lambda=LondonRoad$lambda,Model="Poisson",Method="Gibbs",tune.par=0.5,combine=FALSE)

MartinLHazelton/DynamicLatticeBasis documentation built on March 1, 2024, 3:14 a.m.