Learn R Programming

poseticDataAnalysis (version 1.0.0)

BubleyDyerSeparation: Approximated separation matrices computation, using the Bubley-Dyer procedure (see Bubley and Dyer, 1999).

Description

Computes approximated separation matrices, starting from a set of linear extensions sampled according to the Bubley-Dyer procedure.

Usage

BubleyDyerSeparation(
  generator,
  n = NULL,
  error = NULL,
  output_every_sec = NULL
)

Value

A list containing: 1) the required type of approximated separation matrices, according to the parameter type used to build the generator ( seeBuildBubleyDyerSeparationGenerator()); 2) the number of generated linear extensions.

Arguments

generator

The approximated separation matrices generator created by function BuildBubleyDyerSeparationGenerator().

n

number of linear extensions generated to compute the approximated MRP matrix. See documentation for function BubleyDyerMRP() for further information on this argument.

error

A real number in \((0,1)\) representing the "distance" from uniformity of the sampling distribution of the linear extensions. This parameter is used to determine the number of linear extensions to be sampled. If both arguments n and error are specified by the user, the number of linear extensions actually generated is n. See documentation for function BubleyDyerMRP for further information on this argument.

output_every_sec

Integer specifying a time interval (in seconds). By specifying this argument, during the execution of BubleyDyerSeparation, a message reporting the number of linear extensions progressively generated is printed on the R-Console, every output_every_sec seconds.

Details

See the documentation of BuildBubleyDyerSeparationGenerator() for details on how the different types of separations are defined and computed.

References

Bubley, R., Dyer, M. (1999). Faster random generation of linear extensions. Discrete Mathematics, 201, 81-88. https://doi.org/10.1016/S0012-365X(98)00333-1

Examples

Run this code
el <- c("a", "b", "c", "d")

dom <- matrix(c(
  "a", "b",
  "c", "b",
  "b", "d"
), ncol = 2, byrow = TRUE)

pos <- POSet(elements = el, dom = dom)

BDgen <- BuildBubleyDyerSeparationGenerator(pos, seed = NULL,
                  type="symmetric", "asymmetricUpper", "vertical")

SEP_matrices <- BubleyDyerSeparation(BDgen, n=10000, output_every_sec=5)

Run the code above in your browser using DataLab