Raw File
%- Also NEED an '\alias' for EACH other topic documented here.
Utility Functions for Creating and Validating State Space Partitions
Utility functions for creating and validating state space partitions, to be used in SNS for improving the mixing of sampled chains for high-dimensional posteriors.
sns.make.part(K, nsubset, method = "naive")
sns.check.part(part, K)
%- maybe also 'usage' for other objects documented here.
  \item{K}{Dimensionality of state space.}
  \item{nsubset}{Number of subsets to partition the state space dimensions into.}
  \item{method}{Method used for state space partitioning. Currently, only \code{naive} method is implemented, where coordinates are distributed evenly (or as evenly as possible) across subsets.}
  \item{part}{A list of length \code{nsubset}, with each element a vector of integer values, representing the coordinates belonging to a subset. This list is the output of \code{sns.make.part}.}

\code{sns.make.part} produces a list of integer vectors, each containing coordinates belonging to the same subset. \code{sns.check.part} produces a boolean flag, indicating whether or not the partition list is valid or not. The subset members must constitute a mutually-exclusive, collectively-exhaustive set relative to \code{1:K}.

Alireza S. Mahani, Asad Hasan, Marshall Jiang, Mansour T.A. Sharabiani

\code{\link{sns}}, \code{\link{sns.run}}

# creating a valid partition of a 6-dimensional state space
my.part.valid <- list(c(1,2,3), c(4,5,6))
is.valid.1 <- sns.check.part(my.part.valid, 6)
cat("is partition valid: ", is.valid.1, "\n")

# creating an invalid partition of a 6-dimensional state space
# (coordinate 4 is missing)
my.part.invalid <- list(c(1,2,3), c(5,6))
is.valid.2 <- sns.check.part(my.part.invalid, 6)
cat("is partition valid: ", is.valid.2, "\n")

back to top