bredelings / MCON

0 stars 0 forks source link

Data types and special summaries #5

Open bredelings opened 12 months ago

bredelings commented 12 months ago

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:

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::

    "rates": {"@$record": "DiscreteDistribution",
              "@$value":  {"weights": [0.2, 0.3, 0.5],
                           "values": [0.2, 1.1, 3.4] } }

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.