Expand description
Identity-preserving continuous outcomes during enumeration.
An outcome is a function of one axis: a latent variable, or a linear
form of independent normal latents, as x + y is. It’s affine on each
of a few pieces of the axis’s CDF coordinates, which keeps abs, min,
max and clamp exact. Evidence is a set of intervals in a latent’s
coordinates, and an event a union of boxes of independent axes’ ones.
Worlds own their restrictions, and the latent’s distribution there: a
posterior after an exact update. An observation of several normal
latents together makes each the linear form of fresh independent ones,
which carries their correlation. A value carries the coordinates of the
distribution it was made under, and moves to the world’s when it’s read.
Values and closures remain immutable, and calls return restrictions
alongside their results.
Structs§
- Affine
scale * x + offset, for the latentx.- Analytic
- Domain
- Sorted, disjoint CDF intervals. Endpoints have zero probability.
- Event
- Where independent axes are: a union of disjoint boxes, each a domain of each axis in its CDF coordinates.
- Fun
- The function an outcome is of the draw on a piece of it:
outer, ofkernel, ofinner, of the draw’s value. Monotone on its piece. An affine one has the identity kernel and inner function, so thatouteris all of it. - Latent
- What a world knows about a latent: its distribution, and where it can be, in that distribution’s CDF coordinates. After an observation of several normal latents together, also the linear form of fresh ones that it is now: its distribution is then that form’s, and it’s unrestricted.
- Linear
constant + Σ coef × latentover independent normal latents, by increasing id, none with a zero coefficient.- Term
- One of the independent normal latents of a linear form: its id, its coefficient, and its distribution where the form was made.
Enums§
- Kernel
- A monotone function of a number, between two affine ones in a piece’s function.
- Rounding
- How
floor,ceil,truncandroundmake an int of a number.
Functions§
- abs
- binary
- clamp
clamp(x, lo, hi)with numbers for bounds, which the caller has checked are in order. It’s an int ifxand the bounds are.- collect_
form_ ids - Adds the latents that the forms of those in
idsare made of, which the world must keep knowing about too. - collect_
ids - Latents reachable through an immutable value (including closure captures).
- contains
- Scan through aggregate values too: symbolic numbers must never become categorical keys or be compared by their internal identity as user data.
- extreme
minormaxof numbers and outcomes of one draw. As with numbers, each argument replaces the best so far where it’s strictly better.- has_
outcomes - Whether a value holds an outcome of a draw, other than events.
- joint_
condition - Restricting worlds by an outcome of several normal draws together would make them a truncated joint distribution.
- logic
- marginal
- A value as reports keep it: each outcome of a draw by its marginal alone, without the identity of its draws, so that equal laws merge.
- negate
- normal_
draw - A draw from
normal(mean, sd), withmeanan outcome of normal draws: the mean plus a fresh normal latentidwith standard deviationsd.Noneif the mean isn’t an unrestricted linear form of normal draws. - observe_
normal - Observing
yfromnormal(mean, sd), withmeanan outcome of normal draws: the logarithm of its density, and what the world knows about each latent after it.Noneif the mean isn’t affine in a normal latent or a linear form of several. - outside
- Where an outcome of a draw, by its
pieces, is outside the range fromlotohi, in the draw’s coordinates within its domain. Each bound is included when its flag is. - renamed
- The same value with its latents renamed by
map. - resolve
- Snapshot a value under this world’s posterior without mutating aliases.
- rounded
floor(x),ceil(x),trunc(x)orround(x): an int that is constant on each part of the draw wherexis between two of the rounding’s steps, with that part’s probability. Wherexis constant, it rounds as a number does, ties included; elsewhere a step has no probability.- transformed
sqrt,exporlnof an outcome of a draw. Where the outcome is outside what the function is defined for, with positive probability, it faults there: everywhere is a fault, as for a number; part of the domain isn’t supported yet.- unsupported
- update
- An exact update of a draw
x, read in the world it’s updated in, from observingseenwithxitself as the parameter: the logarithm of the observation’s probability (a density for a normal), and what the world knows about the draw after it.Noneif the draw’s distribution isn’t the prior of a conjugate pair with this observation.
Type Aliases§
- Constraints
- Observed
- An observation’s log density, and what the world knows about each latent after it.
- Pieces
- A function of a latent, by where each of its pieces ends in the latent’s CDF coordinates: the first starts at 0, each other where the one before it ends, and the last ends at 1.