Plate
- class alan.Plate(**kwargs)[source]
The key class used to define your model: all random variables, are defined within a
Plate.An example plate definition:
Plate( a = Normal(0., 1.), g = Group( b = Normal('a', 1.), c = Normal('b', 1.), ), p = Plate( d = Data(), ), )
Everything in the plate is specified as a keyword argument (i.e. of the form
name = thing), wherethingcould be:a distribution (see Distributions).
a
Group.a sub-plate Plate.
Critically, the name becomes the name of that thing. So in the above example, we have normal random variables named
a,b, andc, a group namedg, a sub-plate namedp, and a random variable that will be associated with data, (seeData).Note
In standard Bayesian terminology, including a variable within a plate indicates that there is actually several of these variables. That’s precisely how we’re using sub-plates: each subplates (
pin the example) with have an assigned platesize, and we’ll replicate each variable within the plate that number of times.Note that we also use
Plateat the top-layer, even though we only have one copy of the top-layer variables.