Initialize InferenceData object from keyword xarray datasets.
dict
sets global attribute for InferenceData object.
False
Emit a warning when custom groups are present in the InferenceData. “custom group” means any group whose name isn’t defined in InferenceData schema specification
Keyword arguments of xarray datasets
Examples
Initiate an InferenceData object from scratch, not recommended. InferenceData objects should be initialized using from_xyz
methods, see Data for more details.
In [1]: import arviz as az ...: import numpy as np ...: import xarray as xr ...: dataset = xr.Dataset( ...: { ...: "a": (["chain", "draw", "a_dim"], np.random.normal(size=(4, 100, 3))), ...: "b": (["chain", "draw"], np.random.normal(size=(4, 100))), ...: }, ...: coords={ ...: "chain": (["chain"], np.arange(4)), ...: "draw": (["draw"], np.arange(100)), ...: "a_dim": (["a_dim"], ["x", "y", "z"]), ...: } ...: ) ...: idata = az.InferenceData(posterior=dataset, prior=dataset) ...: idata ...: Out[1]: Inference data with groups: > posterior > prior
We have created an InferenceData
object with two groups. Now we can check its contents:
In [2]: idata.posterior Out[2]: <xarray.Dataset> Size: 14kB Dimensions: (chain: 4, draw: 100, a_dim: 3) Coordinates: * chain (chain) int64 32B 0 1 2 3 * draw (draw) int64 800B 0 1 2 3 4 5 6 7 8 ... 91 92 93 94 95 96 97 98 99 * a_dim (a_dim) <U1 12B 'x' 'y' 'z' Data variables: a (chain, draw, a_dim) float64 10kB -0.6729 0.3382 ... 0.4545 0.5901 b (chain, draw) float64 3kB -1.39 0.03695 0.135 ... -0.01543 -0.03095
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4