You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: doc/source/schema/schema.md
+33-2Lines changed: 33 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -51,13 +51,28 @@ Below are a few rules which should be followed:
51
51
* Dimensions must be named and share name with a coordinate specifying the index values, called coordinate values.
52
52
* Coordinate values can be repeated and should not necessarily be numerical values.
53
53
* Variables must not share names with dimensions.
54
-
55
-
### Relations
54
+
* Groups, variables or the InferenceData itself can have arbitrary metadata stored.
55
+
56
+
### Metadata
57
+
No metadata is _required_ to be present in order to be compliant with the InferenceData schema.
58
+
However, it is recommended to store the following fields when relevant:
59
+
*`name`: InferenceData objects represent multiple quantities related to Bayesian modelling,
60
+
but they are all tied to a single model. The model identifier can be added as metadata
61
+
to simplify the calls to model comparison functions.
62
+
*`created_at`: the date of creation of the group.
63
+
*`arviz_version`: the version of the ArviZ library that generated the InferenceData
64
+
*`arviz_language`: the programming language from which ArviZ was used to create the InferenceData
65
+
*`inference_library`: the library used to run the inference.
66
+
*`inference_library_version`: version of the inference library used.
67
+
68
+
69
+
### Relations between groups
56
70
`InferenceData` data objects contain any combination of the groups described below. There are also some relations (detailed below) between the variables and dimensions of different groups. Hence, whenever related groups are present they should comply with these relations. Neither the presence of groups nor described below or the lack of some of the groups described below go against the schema.
57
71
58
72
#### `posterior`
59
73
Samples from the posterior distribution p(theta|y) in the parameter (also called constrained) space.
60
74
75
+
(schema/unconstrained_posterior)=
61
76
#### `unconstrained_posterior`
62
77
Samples from the posterior distribution p(theta_transformed|y) in the unconstrained (also called transformed) space.
63
78
@@ -68,6 +83,15 @@ and if not, then the values from the variable in the `posterior` group should be
68
83
69
84
Both samples and variables (for those present only) should match between the `posterior` and the `unconstrained_posterior` groups. Note that as defined above, matching samples and variables impose constraints on dimensions and coordinates, not on the values which will be different.
70
85
86
+
:::{note}
87
+
:class: dropdown
88
+
89
+
Both InferenceData groups and variables can have metadata, which in the `unconstrained_posterior`
90
+
case could be used to store the transformations each variable goes through to map between the
91
+
constrained and unconstrained spaces. The schema leaves this completely up to the user
92
+
and imposes on conventions or restrictions on such metadata.
93
+
:::
94
+
71
95
(schema/sample_stats)=
72
96
#### `sample_stats`
73
97
Information and diagnostics for each `posterior` sample, provided by the inference
@@ -162,6 +186,13 @@ generated during the adaptation process should be stored in groups with
162
186
the same name with the `warmup_` prefix, e.g. `warmup_posterior`, `warmup_sample_stats_prior`.
163
187
164
188
#### Unconstrained groups
189
+
Samples on the unconstrained space in cases where the samples need to be generated with
190
+
the help of a sampling algorithm and the sampling algorithm requires transformations
191
+
to an unconstrained space.
192
+
193
+
It is described in more detail in {ref}`schema/unconstrained_posterior` section, which
194
+
is what we expect to be the most common section, but other groups could also have
195
+
an unconstrained linked group, e.g. `prior` and `unconstrained_prior`.
165
196
166
197
## Planned features
167
198
The `InferenceData` structure is still evolving, with some feature being currently developed. This section aims to describe the roadmap of the specification.
0 commit comments