MCMC diagnostics for some objects may depend on what the object means. Similarly, it may be possible to perform visualizations for objects of a certain type.
Examples:
suppose we approximate a function on [0,1] using a piecewise-linear form with an unknown number of pieces. We should be able to generate posterior credible intervals for {f(x)| x in [0,1]}.
the JSON value for variable N might describe a population size history through time for a coalescent model.
the JSON value could describe a discrete distribution with a weighted list of values. If the number of values is constant, we want to sort by both values and weight by the values. If the number of values is not constant, we can still compute the median, variance, etc.
In order to represent more complex objects than arrays and objects, we introduce a special notation.
If a field value contains the keys @$record and @$value then we consider it to represent a record type.
The value for the key @$value must be an object, and its keys represent the fields for that object.
Then we consider this to represent a record shape DiscreteDistribution with fields weights and values.
In order to multiple record shapes to be part of the same data type, we allow an additional key @$type.
In languages like C++ or Java, the record shape would be considered a type.
However, in languages with algebraic data types (such as Rust), a data type can include multiple record shapes.
The purpose of this feature is to indicate the meaning of the values in each Monte Carlo sample so that appropriate summary measures can be computed.
MCMC diagnostics for some objects may depend on what the object means. Similarly, it may be possible to perform visualizations for objects of a certain type.
Examples:
N
might describe a population size history through time for a coalescent model.values
andweight
by thevalues
. If the number of values is not constant, we can still compute the median, variance, etc.In order to represent more complex objects than arrays and objects, we introduce a special notation.
If a field value contains the keys
@$record
and@$value
then we consider it to represent a record type. The value for the key@$value
must be an object, and its keys represent the fields for that object.Thus if we have::
Then we consider this to represent a record shape
DiscreteDistribution
with fieldsweights
andvalues
. In order to multiple record shapes to be part of the same data type, we allow an additional key@$type
. In languages like C++ or Java, the record shape would be considered a type. However, in languages with algebraic data types (such as Rust), a data type can include multiple record shapes.The purpose of this feature is to indicate the meaning of the values in each Monte Carlo sample so that appropriate summary measures can be computed.