Partition

Partition represents a finite partition of the sample space and the finite sigma-field used for conditioning in Chapter 4.

Construction

The preferred public constructors are class methods:

Partition.from_blocks(blocks, space)
Partition.generated_by(random_variable)

Properties

Property Meaning
blocks Partition blocks as finite sets.
n_blocks Number of blocks.

Methods

  • from_blocks(blocks, space) — validate coverage and disjointness and build a partition.
  • generated_by(random_variable) — create the partition generated by the level sets of a random variable.
  • contains(outcome) — return the block containing an outcome.
  • refines(coarser) — test whether the current partition refines another partition.

Example

space = ...
G = Partition.from_blocks(
    [{"H"}, {"T"}],
    space,
)
print(G.n_blocks)
print(G.contains("H"))

Chapter 4 — Espérance conditionnelle