Lecture 23
PyMC is a probabilistic programming library for Python that allows users to build Bayesian models with a simple Python API and fit them using Markov chain Monte Carlo (MCMC) methods.
Modern - Includes state-of-the-art inference algorithms, including MCMC (NUTS) and variational inference (ADVI).
User friendly - Write your models using friendly Python syntax. Learn Bayesian modeling from the many example notebooks.
Fast - Uses PyTensor as its computational backend to compile to C and JAX, run your models on the GPU, and benefit from complex graph-optimizations.
Batteries included - Includes probability distributions, Gaussian processes, ABC, SMC and much more. It integrates nicely with ArviZ for visualizations and diagnostics, as well as Bambi for high-level mixed-effect models.
Community focused - Ask questions on discourse, join MeetUp events, follow us on Twitter, and start contributing.
ArviZ is a Python package for exploratory analysis of Bayesian models. Includes functions for posterior analysis, data storage, sample diagnostics, model checking, and comparison.
Interoperability - Integrates with all major probabilistic programming libraries: PyMC, CmdStanPy, PyStan, Pyro, NumPyro, and emcee.
Large Suite of Visualizations - Provides over 25 plotting functions for all parts of Bayesian workflow: visualizing distributions, diagnostics, and model checking. See the gallery for examples.
State of the Art Diagnostics - Latest published diagnostics and statistics are implemented, tested and distributed with ArviZ.
Flexible Model Comparison - Includes functions for comparing models with information criteria, and cross validation (both approximate and brute force).
Built for Collaboration - Designed for flexible cross-language serialization using netCDF or Zarr formats. ArviZ also has a Julia version that uses the same data schema.
Labeled Data - Builds on top of xarray to work with labeled dimensions and coordinates.
All models are derived from pymc’s Model()
class, unlike what we have seen previously PyMC makes heavy use of Python’s context manager using the with
statement to add model components to a model.
--------------------------------------------------------------------------- TypeError Traceback (most recent call last) File ~/.pyenv/versions/3.12.3/lib/python3.12/site-packages/pymc/distributions/distribution.py:481, in Distribution.__new__(cls, name, rng, dims, initval, observed, total_size, transform, default_transform, *args, **kwargs) 479 from pymc.model import Model --> 481 model = Model.get_context() 482 except TypeError: File ~/.pyenv/versions/3.12.3/lib/python3.12/site-packages/pymc/model/core.py:514, in Model.get_context(cls, error_if_none, allow_block_model_access) 513 if model is None and error_if_none: --> 514 raise TypeError("No model on context stack") 515 return model TypeError: No model on context stack During handling of the above exception, another exception occurred: TypeError Traceback (most recent call last) Cell In[7], line 1 ----> 1 x = pm.Normal("x", mu=0, sigma=1) File ~/.pyenv/versions/3.12.3/lib/python3.12/site-packages/pymc/distributions/distribution.py:483, in Distribution.__new__(cls, name, rng, dims, initval, observed, total_size, transform, default_transform, *args, **kwargs) 481 model = Model.get_context() 482 except TypeError: --> 483 raise TypeError( 484 "No model on context stack, which is needed to " 485 "instantiate distributions. Add variable inside " 486 "a 'with model:' block, or use the '.dist' syntax " 487 "for a standalone distribution." 488 ) 490 if not isinstance(name, string_types): 491 raise TypeError(f"Name needs to be a string but got: {name}") TypeError: No model on context stack, which is needed to instantiate distributions. Add variable inside a 'with model:' block, or use the '.dist' syntax for a standalone distribution.
pm.Normal()
is an example of a PyMC distribution, which are used to construct models, these are implemented using the TensorVariable
class which is used for all of the builtin distributions (and can be used to create custom distributions). Generally you will not be interacting with these objects directly, but they do have some useful methods and attributes:
If you really want to construct a TensorVariable
outside of a model it can be done via the dist
method for each distribution.
Because of this construction it is possible to add additional components to an existing (named) model via subsequent with
statements (only the first needs pm.Model()
)
Note that we defined \(y|x \sim \mathcal{N}(x, 1)\), so what is happening when we use pm.draw(norm.y)
?
Each time we ask for a draw from y
, PyMC is first drawing from x
for us.
We will now build a basic model where we know what the solution should look like and compare the results.
pm.sample()
resultsXarray (formerly xray) is an open source project and Python package that makes working with labelled multi-dimensional arrays simple, efficient, and fun!
Xarray introduces labels in the form of dimensions, coordinates and attributes on top of raw NumPy-like arrays, which allows for a more intuitive, more concise, and less error-prone developer experience. The package includes a large and growing library of domain-agnostic functions for advanced analytics and visualization with these data structures.
Xarray is inspired by and borrows heavily from pandas, the popular data analysis package focused on labelled tabular data. It is particularly tailored to working with netCDF files, which were the source of xarray’s data model, and integrates tightly with dask for parallel computing.
trace
<xarray.Dataset> Size: 40kB
Dimensions: (chain: 4, draw: 1000)
Coordinates:
* chain (chain) int64 32B 0 1 2 3
* draw (draw) int64 8kB 0 1 2 3 4 5 6 7 ... 993 994 995 996 997 998 999
Data variables:
p (chain, draw) float64 32kB 0.3347 0.3435 0.2629 ... 0.3276 0.3486
Attributes:
created_at: 2025-04-11T13:49:19.633849+00:00
arviz_version: 0.21.0
inference_library: pymc
inference_library_version: 5.22.0
sampling_time: 0.2469632625579834
tuning_steps: 1000
Posterior values, or subsets, can be converted to DataFrames via the to_dataframe()
method
Standard MCMC diagnostic statistics are available via summary()
from ArviZ
individual methods are available for each statistics,
<xarray.Dataset> Size: 8B
Dimensions: ()
Data variables:
p float64 8B 1.757e+03
Given the below data, we want to fit a linear regression model to the following synthetic data,
post_m = trace.posterior['m'].sel(chain=0, draw=slice(0,None,10))
post_b = trace.posterior['b'].sel(chain=0, draw=slice(0,None,10))
plt.figure(layout="constrained")
plt.scatter(x, y, s=30, label='data')
for m, b in zip(post_m.values, post_b.values):
plt.plot(x, m*x + b, c='gray', alpha=0.1)
plt.plot(x, 6*x + 2, label='true regression line', lw=3., c='red')
plt.legend(loc='best')
plt.show()
Draws for observed variables can also be generated (posterior predictive draws) via the sample_posterior_predictive()
method.
<xarray.Dataset> Size: 360kB Dimensions: (chain: 4, draw: 1000, y_dim_0: 11) Coordinates: * chain (chain) int64 32B 0 1 2 3 * draw (draw) int64 8kB 0 1 2 3 4 5 6 7 ... 993 994 995 996 997 998 999 * y_dim_0 (y_dim_0) int64 88B 0 1 2 3 4 5 6 7 8 9 10 Data variables: y (chain, draw, y_dim_0) float64 352kB 3.174 1.878 ... 11.77 8.377 Attributes: created_at: 2025-04-11T13:49:25.729741+00:00 arviz_version: 0.21.0 inference_library: pymc inference_library_version: 5.22.0
array([0, 1, 2, 3])
array([ 0, 1, 2, ..., 997, 998, 999], shape=(1000,))
array([ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10])
array([[[ 3.17354, 1.87805, 3.76852, ..., 6.54175, 7.43742, 7.78914], [ 2.27983, 3.96314, 3.09305, ..., 7.21424, 9.03142, 6.38638], [ 2.20723, 3.43384, 3.83355, ..., 6.76013, 6.9187 , 8.6754 ], ..., [ 0.29082, 4.77697, 4.79924, ..., 7.0838 , 9.53583, 6.54721], [ 0.49121, 4.01093, 4.34301, ..., 8.26819, 5.90965, 7.28212], [ 4.06517, 5.04653, -0.05754, ..., 6.51541, 7.88574, 7.16926]], [[-0.30732, 0.95577, 5.05144, ..., 8.59496, 6.70981, 11.01656], [ 1.60248, 0.6971 , 2.12415, ..., 7.09078, 6.89277, 6.65546], [ 0.1228 , 2.27554, 2.15267, ..., 5.63323, 8.29565, 8.90576], ..., [ 4.78796, 2.52049, 2.84617, ..., 6.00089, 9.73012, 11.80018], [ 1.30429, 4.09085, 2.55005, ..., 7.50219, 7.15119, 7.54882], [ 1.99755, 3.77501, 3.27743, ..., 9.47348, 6.11838, 7.38766]], [[ 0.595 , 0.85657, 2.1537 , ..., 4.28652, 8.44684, 9.82931], [ 2.20349, 2.95171, 4.49382, ..., 7.68846, 6.35695, 6.06655], [ 3.44872, 4.35948, 5.2881 , ..., 7.8373 , 7.85919, 5.52693], ..., [ 2.7894 , 3.73768, 4.7869 , ..., 4.90028, 6.39801, 6.71537], [ 1.76586, 6.95648, 3.18804, ..., 7.58321, 14.56387, 6.12913], [ 1.56073, 3.9692 , 3.37876, ..., 8.0759 , 5.45177, 9.50002]], [[ 1.02056, 3.40847, 2.13945, ..., 6.12481, 3.45727, 9.43489], [ 2.24491, -0.29755, -0.50703, ..., 6.7105 , 5.66517, 6.1413 ], [ 2.57412, 3.12914, 3.15776, ..., 7.23719, 4.89609, 9.32784], ..., [ 0.51275, 2.7002 , 3.83325, ..., 7.03997, 7.80922, 6.07145], [ 1.44511, 3.80403, 3.61634, ..., 4.6687 , 6.93022, 7.20943], [ 4.13217, 2.35127, 3.78738, ..., 5.6823 , 11.76799, 8.37661]]], shape=(4, 1000, 11))
PandasIndex(Index([0, 1, 2, 3], dtype='int64', name='chain'))
PandasIndex(Index([ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, ... 990, 991, 992, 993, 994, 995, 996, 997, 998, 999], dtype='int64', name='draw', length=1000))
PandasIndex(Index([0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10], dtype='int64', name='y_dim_0'))
<xarray.Dataset> Size: 176B Dimensions: (y_dim_0: 11) Coordinates: * y_dim_0 (y_dim_0) int64 88B 0 1 2 3 4 5 6 7 8 9 10 Data variables: y (y_dim_0) float64 88B 2.471 1.409 4.633 3.487 ... 6.816 5.157 9.15 Attributes: created_at: 2025-04-11T13:49:25.731960+00:00 arviz_version: 0.21.0 inference_library: pymc inference_library_version: 5.22.0
array([ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10])
array([2.47144, 1.40902, 4.63271, 3.48735, 3.67941, 5.88716, 6.45959, 5.56348, 6.8157 , 5.15732, 9.15004])
PandasIndex(Index([0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10], dtype='int64', name='y_dim_0'))
with pm.Model() as lm2:
m = pm.Normal('m', mu=0, sigma=50)
b = pm.Normal('b', mu=0, sigma=50)
sigma = pm.HalfNormal('sigma', sigma=5)
y_hat = pm.Deterministic("y_hat", m*x + b)
likelihood = pm.Normal('y', mu=y_hat, sigma=sigma, observed=y)
trace = pm.sample(random_seed=1234, progressbar=False)
pp = pm.sample_posterior_predictive(trace, var_names=["y_hat"], progressbar=False)
mean | sd | hdi_3% | hdi_97% | mcse_mean | mcse_sd | ess_bulk | ess_tail | r_hat | |
---|---|---|---|---|---|---|---|---|---|
b | 2.166 | 0.778 | 0.685 | 3.596 | 0.022 | 0.019 | 1230.0 | 1576.0 | 1.0 |
m | 5.627 | 1.321 | 3.179 | 8.103 | 0.037 | 0.032 | 1282.0 | 1596.0 | 1.0 |
sigma | 1.374 | 0.406 | 0.721 | 2.041 | 0.010 | 0.016 | 1614.0 | 1260.0 | 1.0 |
y_hat[0] | 2.166 | 0.778 | 0.685 | 3.596 | 0.022 | 0.019 | 1230.0 | 1576.0 | 1.0 |
y_hat[1] | 2.729 | 0.672 | 1.476 | 4.006 | 0.019 | 0.016 | 1294.0 | 1537.0 | 1.0 |
y_hat[2] | 3.291 | 0.576 | 2.240 | 4.433 | 0.016 | 0.013 | 1420.0 | 1648.0 | 1.0 |
y_hat[3] | 3.854 | 0.497 | 2.936 | 4.811 | 0.012 | 0.011 | 1715.0 | 1959.0 | 1.0 |
y_hat[4] | 4.417 | 0.444 | 3.556 | 5.218 | 0.009 | 0.009 | 2448.0 | 2475.0 | 1.0 |
y_hat[5] | 4.980 | 0.427 | 4.176 | 5.762 | 0.007 | 0.009 | 3762.0 | 2262.0 | 1.0 |
y_hat[6] | 5.542 | 0.450 | 4.717 | 6.393 | 0.007 | 0.010 | 4249.0 | 2635.0 | 1.0 |
y_hat[7] | 6.105 | 0.507 | 5.187 | 7.077 | 0.009 | 0.011 | 3614.0 | 2566.0 | 1.0 |
y_hat[8] | 6.668 | 0.589 | 5.499 | 7.713 | 0.011 | 0.012 | 2804.0 | 2318.0 | 1.0 |
y_hat[9] | 7.230 | 0.687 | 5.911 | 8.473 | 0.014 | 0.014 | 2358.0 | 2265.0 | 1.0 |
y_hat[10] | 7.793 | 0.794 | 6.226 | 9.198 | 0.018 | 0.016 | 2088.0 | 2214.0 | 1.0 |
mean | sd | hdi_3% | hdi_97% | mcse_mean | mcse_sd | ess_bulk | ess_tail | r_hat | |
---|---|---|---|---|---|---|---|---|---|
beta[0] | 242.625 | 995.218 | -1000.355 | 2950.690 | 434.973 | 319.426 | 6.0 | 11.0 | 2.16 |
beta[1] | -574.362 | 656.294 | -1402.057 | 358.625 | 298.857 | 116.629 | 6.0 | 28.0 | 1.83 |
beta[2] | -1014.882 | 528.442 | -1886.908 | 167.967 | 168.015 | 136.215 | 9.0 | 17.0 | 1.39 |
beta[3] | 78.346 | 788.822 | -860.682 | 1472.876 | 370.525 | 171.538 | 5.0 | 11.0 | 2.48 |
beta[4] | 551.583 | 777.056 | -454.753 | 1975.072 | 332.438 | 175.438 | 6.0 | 13.0 | 1.86 |
... | ... | ... | ... | ... | ... | ... | ... | ... | ... |
beta[96] | -702.573 | 880.101 | -2461.944 | 820.584 | 409.925 | 269.151 | 5.0 | 11.0 | 2.54 |
beta[97] | 117.851 | 813.313 | -1336.065 | 1519.139 | 387.280 | 201.783 | 5.0 | 12.0 | 2.98 |
beta[98] | -297.373 | 995.011 | -2420.511 | 1270.081 | 430.002 | 236.156 | 5.0 | 26.0 | 2.27 |
beta[99] | 493.648 | 1248.412 | -956.249 | 2742.285 | 598.336 | 261.016 | 5.0 | 15.0 | 2.65 |
sigma | 2.498 | 1.021 | 1.298 | 4.470 | 0.363 | 0.063 | 9.0 | 78.0 | 1.44 |
101 rows × 9 columns
mean | sd | hdi_3% | hdi_97% | mcse_mean | mcse_sd | ess_bulk | ess_tail | r_hat | |
---|---|---|---|---|---|---|---|---|---|
beta[0] | 0.311 | 7.613 | -13.351 | 15.058 | 0.105 | 0.137 | 5329.0 | 2526.0 | 1.00 |
beta[1] | 1.233 | 6.587 | -11.725 | 13.485 | 0.087 | 0.115 | 5716.0 | 2590.0 | 1.00 |
beta[2] | -0.120 | 7.743 | -14.607 | 13.999 | 0.104 | 0.175 | 5597.0 | 2117.0 | 1.00 |
beta[3] | -1.485 | 6.990 | -14.770 | 11.764 | 0.089 | 0.125 | 6156.0 | 2846.0 | 1.00 |
beta[4] | 0.877 | 7.454 | -13.828 | 14.448 | 0.103 | 0.125 | 5269.0 | 2631.0 | 1.00 |
... | ... | ... | ... | ... | ... | ... | ... | ... | ... |
beta[96] | -0.377 | 6.414 | -12.167 | 11.563 | 0.089 | 0.107 | 5098.0 | 2949.0 | 1.00 |
beta[97] | -0.783 | 6.470 | -13.404 | 10.882 | 0.089 | 0.109 | 5318.0 | 2669.0 | 1.00 |
beta[98] | 1.443 | 6.720 | -10.492 | 14.634 | 0.105 | 0.120 | 4091.0 | 2324.0 | 1.00 |
beta[99] | -1.201 | 6.854 | -13.770 | 12.981 | 0.093 | 0.121 | 5426.0 | 2993.0 | 1.00 |
sigma | 2.259 | 1.056 | 0.635 | 4.159 | 0.117 | 0.055 | 75.0 | 143.0 | 1.05 |
101 rows × 9 columns
mean | sd | hdi_3% | hdi_97% | mcse_mean | mcse_sd | ess_bulk | ess_tail | r_hat | |
---|---|---|---|---|---|---|---|---|---|
beta[10] | 3.951 | 7.004 | -9.375 | 16.974 | 0.115 | 0.127 | 3729.0 | 2376.0 | 1.0 |
beta[20] | -4.504 | 7.036 | -18.159 | 8.207 | 0.097 | 0.115 | 5239.0 | 2944.0 | 1.0 |
beta[30] | 5.473 | 6.723 | -7.496 | 17.680 | 0.104 | 0.126 | 4182.0 | 2049.0 | 1.0 |
beta[40] | -4.949 | 8.112 | -19.896 | 11.253 | 0.097 | 0.162 | 7039.0 | 2573.0 | 1.0 |
beta[50] | 5.392 | 6.492 | -6.410 | 17.520 | 0.089 | 0.106 | 5294.0 | 3012.0 | 1.0 |
beta[60] | -5.692 | 7.026 | -18.329 | 8.414 | 0.097 | 0.128 | 5259.0 | 2191.0 | 1.0 |
beta[70] | 4.644 | 7.427 | -8.624 | 19.128 | 0.110 | 0.146 | 4585.0 | 1979.0 | 1.0 |
beta[80] | -7.800 | 6.097 | -19.094 | 3.737 | 0.082 | 0.095 | 5551.0 | 3325.0 | 1.0 |
def plot_slope(trace, prior="beta", chain=0):
post = (trace.posterior[prior]
.to_dataframe()
.reset_index()
.query(f"chain == {chain}")
)
sns.catplot(x="beta_dim_0", y="beta", data=post, kind="boxen", linewidth=0, color='blue', aspect=2, showfliers=False)
plt.tight_layout()
plt.xticks(range(0,110,10))
plt.show()
mean | sd | hdi_3% | hdi_97% | mcse_mean | mcse_sd | ess_bulk | ess_tail | r_hat | |
---|---|---|---|---|---|---|---|---|---|
beta[0] | 0.079 | 0.846 | -1.540 | 1.765 | 0.015 | 0.020 | 3605.0 | 2149.0 | 1.00 |
beta[1] | 0.212 | 0.738 | -1.148 | 1.709 | 0.011 | 0.016 | 4542.0 | 2608.0 | 1.00 |
beta[2] | -0.057 | 0.803 | -1.692 | 1.382 | 0.013 | 0.017 | 3748.0 | 2732.0 | 1.00 |
beta[3] | -0.280 | 0.777 | -1.826 | 1.146 | 0.014 | 0.017 | 3336.0 | 1972.0 | 1.00 |
beta[4] | 0.075 | 0.859 | -1.596 | 1.708 | 0.017 | 0.026 | 2979.0 | 1849.0 | 1.00 |
... | ... | ... | ... | ... | ... | ... | ... | ... | ... |
beta[96] | 0.061 | 0.752 | -1.435 | 1.558 | 0.017 | 0.018 | 2233.0 | 1258.0 | 1.00 |
beta[97] | -0.143 | 0.718 | -1.536 | 1.257 | 0.013 | 0.016 | 2932.0 | 2380.0 | 1.00 |
beta[98] | 0.300 | 0.743 | -0.997 | 1.752 | 0.016 | 0.016 | 2268.0 | 2275.0 | 1.01 |
beta[99] | -0.289 | 0.775 | -1.839 | 1.144 | 0.015 | 0.017 | 2792.0 | 1483.0 | 1.00 |
sigma | 0.902 | 0.497 | 0.276 | 1.848 | 0.058 | 0.032 | 70.0 | 141.0 | 1.03 |
101 rows × 9 columns
mean | sd | hdi_3% | hdi_97% | mcse_mean | mcse_sd | ess_bulk | ess_tail | r_hat | |
---|---|---|---|---|---|---|---|---|---|
beta[10] | 8.349 | 1.248 | 5.734 | 10.493 | 0.027 | 0.023 | 2153.0 | 2169.0 | 1.00 |
beta[20] | -8.315 | 1.294 | -10.647 | -5.822 | 0.027 | 0.021 | 2249.0 | 2290.0 | 1.00 |
beta[30] | 8.627 | 1.004 | 6.788 | 10.530 | 0.026 | 0.017 | 1458.0 | 1200.0 | 1.00 |
beta[40] | -8.772 | 1.641 | -11.756 | -5.558 | 0.043 | 0.035 | 1556.0 | 1303.0 | 1.00 |
beta[50] | 9.003 | 1.010 | 7.089 | 10.897 | 0.022 | 0.018 | 2027.0 | 2524.0 | 1.00 |
beta[60] | -9.230 | 1.174 | -11.417 | -6.972 | 0.034 | 0.027 | 1178.0 | 597.0 | 1.01 |
beta[70] | 8.512 | 1.172 | 6.203 | 10.570 | 0.025 | 0.021 | 2260.0 | 2035.0 | 1.00 |
beta[80] | -9.919 | 0.869 | -11.531 | -8.265 | 0.018 | 0.015 | 2224.0 | 2657.0 | 1.00 |
Based on PyMC Out-Of-Sample Predictions example
x1 | x2 | y | |
---|---|---|---|
0 | -3.207674 | 0.859021 | 0 |
1 | 0.128200 | 2.827588 | 0 |
2 | 1.481783 | -0.116956 | 0 |
3 | 0.305238 | -1.378604 | 0 |
4 | 1.727488 | -0.926357 | 1 |
... | ... | ... | ... |
245 | -2.182813 | 3.314672 | 0 |
246 | -2.362568 | 2.078652 | 0 |
247 | 0.114571 | 2.249021 | 0 |
248 | 2.093975 | -1.212528 | 1 |
249 | 1.241667 | -2.363412 | 0 |
250 rows × 3 columns
with pm.Model(coords = {"coeffs": X_lab}) as model:
# data containers
X = pm.MutableData("X", X_train)
y = pm.MutableData("y", y_train)
# priors
b = pm.Normal("b", mu=0, sigma=3, dims="coeffs")
# linear model
mu = X @ b
# link function
p = pm.Deterministic("p", pm.math.invlogit(mu))
# likelihood
obs = pm.Bernoulli("obs", p=p, observed=y)
mean | sd | hdi_3% | hdi_97% | mcse_mean | mcse_sd | ess_bulk | ess_tail | r_hat | |
---|---|---|---|---|---|---|---|---|---|
b[Intercept] | -0.895 | 0.330 | -1.513 | -0.294 | 0.010 | 0.005 | 1203.0 | 2281.0 | 1.0 |
b[x1] | 1.299 | 0.341 | 0.662 | 1.913 | 0.010 | 0.006 | 1172.0 | 2033.0 | 1.0 |
b[x2] | -1.634 | 0.352 | -2.339 | -1.024 | 0.010 | 0.006 | 1297.0 | 1947.0 | 1.0 |
b[x1:x2] | 2.714 | 0.496 | 1.843 | 3.660 | 0.014 | 0.009 | 1199.0 | 1766.0 | 1.0 |
p[0] | 0.938 | 0.036 | 0.871 | 0.992 | 0.001 | 0.001 | 2382.0 | 2704.0 | 1.0 |
... | ... | ... | ... | ... | ... | ... | ... | ... | ... |
p[170] | 0.000 | 0.000 | 0.000 | 0.000 | 0.000 | 0.000 | 1480.0 | 2089.0 | 1.0 |
p[171] | 0.222 | 0.109 | 0.047 | 0.430 | 0.002 | 0.002 | 3924.0 | 3036.0 | 1.0 |
p[172] | 1.000 | 0.000 | 1.000 | 1.000 | 0.000 | 0.000 | 1936.0 | 2541.0 | 1.0 |
p[173] | 0.792 | 0.065 | 0.670 | 0.907 | 0.001 | 0.001 | 2632.0 | 2880.0 | 1.0 |
p[174] | 0.623 | 0.075 | 0.480 | 0.760 | 0.001 | 0.001 | 3234.0 | 3044.0 | 1.0 |
179 rows × 9 columns
<xarray.Dataset> Size: 6MB Dimensions: (chain: 4, draw: 1000, coeffs: 4, p_dim_0: 175) Coordinates: * chain (chain) int64 32B 0 1 2 3 * draw (draw) int64 8kB 0 1 2 3 4 5 6 7 ... 993 994 995 996 997 998 999 * coeffs (coeffs) <U9 144B 'Intercept' 'x1' 'x2' 'x1:x2' * p_dim_0 (p_dim_0) int64 1kB 0 1 2 3 4 5 6 7 ... 168 169 170 171 172 173 174 Data variables: b (chain, draw, coeffs) float64 128kB -0.5695 1.461 ... -1.73 3.145 p (chain, draw, p_dim_0) float64 6MB 0.9187 0.3723 ... 0.8316 0.6381 Attributes: created_at: 2025-04-11T13:50:50.322398+00:00 arviz_version: 0.21.0 inference_library: pymc inference_library_version: 5.22.0 sampling_time: 0.42817115783691406 tuning_steps: 1000
array([0, 1, 2, 3])
array([ 0, 1, 2, ..., 997, 998, 999], shape=(1000,))
array(['Intercept', 'x1', 'x2', 'x1:x2'], dtype='<U9')
array([ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, 174])
array([[[-0.5695 , 1.46066, -1.32844, 2.47237], [-0.91906, 1.21047, -1.96817, 2.49658], [-0.86849, 1.06545, -1.81086, 3.14778], ..., [-0.9169 , 1.37703, -1.67935, 2.74955], [-1.11022, 1.74579, -1.97351, 3.23752], [-0.72192, 0.98898, -1.48822, 2.11274]], [[-0.85331, 1.18927, -1.57627, 2.53874], [-1.37937, 1.057 , -1.58756, 2.42398], [-1.18949, 1.09326, -1.89909, 2.81857], ..., [-1.15542, 1.27359, -2.23515, 3.09038], [-0.80025, 1.38231, -1.30632, 2.27614], [-1.07163, 1.25889, -1.52186, 2.67609]], [[-0.45987, 1.31232, -1.70091, 3.13744], [-0.46152, 1.48017, -1.71725, 3.56678], [-0.89999, 1.50536, -1.65763, 2.46137], ..., [-0.92148, 1.38658, -1.68688, 2.85536], [-0.59091, 0.93949, -1.24693, 2.0211 ], [-1.05733, 1.74925, -2.19572, 3.20408]], [[-1.20406, 1.70135, -2.06492, 3.14836], [-1.45473, 1.67529, -2.34104, 3.69555], [-0.86138, 1.43605, -1.31106, 2.87827], ..., [-1.41904, 1.21938, -1.73175, 2.73894], [-0.33409, 1.19127, -1.389 , 2.24063], [-0.84561, 1.26785, -1.73035, 3.14513]]], shape=(4, 1000, 4))
array([[[0.91865, 0.37228, 0.0436 , ..., 0.99999, 0.78276, 0.7324 ], [0.95699, 0.19123, 0.02683, ..., 1. , 0.85688, 0.58473], [0.97933, 0.23965, 0.00163, ..., 1. , 0.84453, 0.58285], ..., [0.94746, 0.24971, 0.01387, ..., 1. , 0.80565, 0.63833], [0.96264, 0.21698, 0.0093 , ..., 1. , 0.83635, 0.68193], [0.92457, 0.26149, 0.03592, ..., 0.99999, 0.79238, 0.58155]], [[0.94127, 0.25566, 0.01519, ..., 1. , 0.79328, 0.60664], [0.90536, 0.15789, 0.00901, ..., 1. , 0.69688, 0.44077], [0.96214, 0.16567, 0.00443, ..., 1. , 0.81157, 0.49918], ..., [0.9782 , 0.15207, 0.00456, ..., 1. , 0.87506, 0.55068], [0.88264, 0.30798, 0.05168, ..., 0.99997, 0.7333 , 0.66362], [0.92969, 0.23351, 0.00894, ..., 1. , 0.74298, 0.57559]], [[0.97986, 0.35789, 0.00484, ..., 1. , 0.87448, 0.73099], [0.9857 , 0.39196, 0.00189, ..., 1. , 0.87914, 0.77016], [0.91882, 0.25035, 0.05334, ..., 0.99999, 0.79907, 0.66474], ..., [0.95298, 0.25325, 0.00999, ..., 1. , 0.80767, 0.64187], [0.90844, 0.31897, 0.03682, ..., 0.99998, 0.75933, 0.60513], [0.97133, 0.19624, 0.01416, ..., 1. , 0.87799, 0.68819]], [[0.96098, 0.18478, 0.01108, ..., 1. , 0.83934, 0.64686], [0.98083, 0.13918, 0.00165, ..., 1. , 0.85929, 0.58841], [0.93107, 0.32998, 0.00755, ..., 1. , 0.73104, 0.67601], ..., [0.93044, 0.15501, 0.00569, ..., 1. , 0.7305 , 0.47557], [0.93859, 0.3829 , 0.05604, ..., 0.99999, 0.83128, 0.71965], [0.97303, 0.26788, 0.00289, ..., 1. , 0.83164, 0.63814]]], shape=(4, 1000, 175))
PandasIndex(Index([0, 1, 2, 3], dtype='int64', name='chain'))
PandasIndex(Index([ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, ... 990, 991, 992, 993, 994, 995, 996, 997, 998, 999], dtype='int64', name='draw', length=1000))
PandasIndex(Index(['Intercept', 'x1', 'x2', 'x1:x2'], dtype='object', name='coeffs'))
PandasIndex(Index([ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, ... 165, 166, 167, 168, 169, 170, 171, 172, 173, 174], dtype='int64', name='p_dim_0', length=175))
<xarray.Dataset> Size: 496kB Dimensions: (chain: 4, draw: 1000) Coordinates: * chain (chain) int64 32B 0 1 2 3 * draw (draw) int64 8kB 0 1 2 3 4 5 ... 995 996 997 998 999 Data variables: (12/17) acceptance_rate (chain, draw) float64 32kB 0.4819 0.7555 ... 0.7986 diverging (chain, draw) bool 4kB False False ... False False energy (chain, draw) float64 32kB 60.19 57.69 ... 57.79 energy_error (chain, draw) float64 32kB 0.0 0.6809 ... 0.02024 index_in_trajectory (chain, draw) int64 32kB 0 -4 -2 -1 2 ... 1 3 -6 3 -3 largest_eigval (chain, draw) float64 32kB nan nan nan ... nan nan ... ... process_time_diff (chain, draw) float64 32kB 8.7e-05 ... 0.000219 reached_max_treedepth (chain, draw) bool 4kB False False ... False False smallest_eigval (chain, draw) float64 32kB nan nan nan ... nan nan step_size (chain, draw) float64 32kB 0.4638 0.4638 ... 0.4466 step_size_bar (chain, draw) float64 32kB 0.4786 0.4786 ... 0.4723 tree_depth (chain, draw) int64 32kB 2 3 2 3 4 2 ... 3 3 3 3 4 4 Attributes: created_at: 2025-04-11T13:50:50.328894+00:00 arviz_version: 0.21.0 inference_library: pymc inference_library_version: 5.22.0 sampling_time: 0.42817115783691406 tuning_steps: 1000
array([0, 1, 2, 3])
array([ 0, 1, 2, ..., 997, 998, 999], shape=(1000,))
array([[0.48185, 0.75548, 1. , ..., 0.6928 , 0.85403, 0.81717], [0.99205, 0.64292, 0.88393, ..., 1. , 0.79153, 1. ], [0.83282, 0.87441, 0.8058 , ..., 1. , 0.98665, 0.10584], [0.4735 , 0.62884, 0.8561 , ..., 0.77434, 0.94339, 0.7986 ]], shape=(4, 1000))
array([[False, False, False, ..., False, False, False], [False, False, False, ..., False, False, False], [False, False, False, ..., False, False, False], [False, False, False, ..., False, False, False]], shape=(4, 1000))
array([[60.18647, 57.69275, 57.48299, ..., 55.87092, 56.36287, 56.67249], [54.74467, 57.01666, 58.47333, ..., 56.62219, 57.55791, 55.61526], [58.45947, 59.80052, 60.26114, ..., 54.8342 , 54.78261, 59.76395], [58.19455, 61.26769, 58.50347, ..., 57.05287, 58.14855, 57.78647]], shape=(4, 1000))
array([[ 0. , 0.68094, -0.33188, ..., -0.08163, 0.0724 , -0.00224], [-0.02653, 0.35912, -0.03844, ..., -0.06479, -1.11556, -0.18342], [ 0.27132, 0.44647, -1.232 , ..., -0.08708, 0.02903, 0.58175], [ 0. , 0.33049, 0.23939, ..., 0.00731, 0.18652, 0.02024]], shape=(4, 1000))
array([[ 0, -4, -2, ..., -3, -5, 6], [ 1, -2, -2, ..., -4, -4, 2], [-4, 1, -2, ..., -2, -5, 4], [ 0, -5, 5, ..., -6, 3, -3]], shape=(4, 1000))
array([[nan, nan, nan, ..., nan, nan, nan], [nan, nan, nan, ..., nan, nan, nan], [nan, nan, nan, ..., nan, nan, nan], [nan, nan, nan, ..., nan, nan, nan]], shape=(4, 1000))
array([[-55.61979, -56.61982, -56.34389, ..., -53.86998, -54.92231, -54.76066], [-53.75155, -56.46697, -55.65965, ..., -56.40062, -55.11841, -54.26766], [-56.34953, -58.75698, -55.45519, ..., -53.97488, -54.36662, -55.91831], [-54.98731, -56.66002, -55.91184, ..., -55.85943, -55.95399, -55.30691]], shape=(4, 1000))
array([[ 1.52859, 0.68094, -0.82933, ..., 0.91573, 0.22896, 0.60845], [-0.02653, 0.65449, 0.42802, ..., -0.34745, 1.19951, -0.24978], [ 0.39346, -0.98629, -1.70315, ..., -0.10375, 0.05023, 73.09179], [ 1.00243, 0.68934, 0.44313, ..., 0.7909 , -0.31329, 1.43742]], shape=(4, 1000))
array([[ 3., 7., 3., ..., 7., 7., 11.], [15., 7., 3., ..., 7., 11., 7.], [15., 7., 7., ..., 11., 11., 11.], [ 3., 7., 7., ..., 7., 11., 11.]], shape=(4, 1000))
array([[0.00009, 0.00016, 0.00008, ..., 0.00015, 0.00015, 0.00023], [0.0003 , 0.00015, 0.00008, ..., 0.00016, 0.00023, 0.00015], [0.0003 , 0.00015, 0.00015, ..., 0.00026, 0.00026, 0.00028], [0.00008, 0.00015, 0.00015, ..., 0.00017, 0.00022, 0.00022]], shape=(4, 1000))
array([[45128.01884, 45128.01895, 45128.01915, ..., 45128.19928, 45128.19945, 45128.19963], [45128.0227 , 45128.02304, 45128.02321, ..., 45128.20326, 45128.20345, 45128.2037 ], [45128.0201 , 45128.02043, 45128.02061, ..., 45128.20371, 45128.20401, 45128.20623], [45128.02341, 45128.02352, 45128.0237 , ..., 45128.20623, 45128.20642, 45128.20666]], shape=(4, 1000))
array([[0.00009, 0.00016, 0.00008, ..., 0.00015, 0.00015, 0.00023], [0.0003 , 0.00015, 0.00008, ..., 0.00016, 0.00023, 0.00015], [0.0003 , 0.00015, 0.00015, ..., 0.00027, 0.00026, 0.00028], [0.00008, 0.00016, 0.00015, ..., 0.00017, 0.00022, 0.00022]], shape=(4, 1000))
array([[False, False, False, ..., False, False, False], [False, False, False, ..., False, False, False], [False, False, False, ..., False, False, False], [False, False, False, ..., False, False, False]], shape=(4, 1000))
array([[nan, nan, nan, ..., nan, nan, nan], [nan, nan, nan, ..., nan, nan, nan], [nan, nan, nan, ..., nan, nan, nan], [nan, nan, nan, ..., nan, nan, nan]], shape=(4, 1000))
array([[0.46383, 0.46383, 0.46383, ..., 0.46383, 0.46383, 0.46383], [0.36179, 0.36179, 0.36179, ..., 0.36179, 0.36179, 0.36179], [0.38215, 0.38215, 0.38215, ..., 0.38215, 0.38215, 0.38215], [0.4466 , 0.4466 , 0.4466 , ..., 0.4466 , 0.4466 , 0.4466 ]], shape=(4, 1000))
array([[0.47863, 0.47863, 0.47863, ..., 0.47863, 0.47863, 0.47863], [0.44534, 0.44534, 0.44534, ..., 0.44534, 0.44534, 0.44534], [0.47785, 0.47785, 0.47785, ..., 0.47785, 0.47785, 0.47785], [0.47232, 0.47232, 0.47232, ..., 0.47232, 0.47232, 0.47232]], shape=(4, 1000))
array([[2, 3, 2, ..., 3, 3, 4], [4, 3, 2, ..., 3, 4, 3], [4, 3, 3, ..., 4, 4, 4], [2, 3, 3, ..., 3, 4, 4]], shape=(4, 1000))
PandasIndex(Index([0, 1, 2, 3], dtype='int64', name='chain'))
PandasIndex(Index([ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, ... 990, 991, 992, 993, 994, 995, 996, 997, 998, 999], dtype='int64', name='draw', length=1000))
<xarray.Dataset> Size: 3kB Dimensions: (obs_dim_0: 175) Coordinates: * obs_dim_0 (obs_dim_0) int64 1kB 0 1 2 3 4 5 6 ... 169 170 171 172 173 174 Data variables: obs (obs_dim_0) int64 1kB 1 0 0 1 0 1 0 1 0 1 ... 1 0 0 1 0 0 0 1 1 1 Attributes: created_at: 2025-04-11T13:50:50.331861+00:00 arviz_version: 0.21.0 inference_library: pymc inference_library_version: 5.22.0
array([ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, 174])
array([1, 0, 0, 1, 0, 1, 0, 1, 0, 1, 1, 0, 0, 1, 1, 1, 1, 0, 1, 1, 0, 0, 1, 1, 0, 0, 1, 0, 1, 1, 0, 1, 0, 1, 1, 1, 0, 1, 0, 0, 0, 1, 1, 1, 0, 1, 1, 1, 0, 0, 0, 1, 1, 0, 0, 0, 1, 0, 0, 1, 1, 0, 1, 0, 0, 0, 0, 0, 1, 1, 0, 1, 0, 1, 0, 1, 1, 0, 0, 1, 0, 1, 0, 1, 0, 0, 0, 1, 0, 0, 1, 0, 1, 0, 1, 1, 0, 1, 1, 0, 1, 0, 1, 0, 1, 0, 0, 1, 0, 0, 1, 1, 0, 0, 0, 0, 1, 0, 1, 1, 0, 0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 1, 1, 1, 0, 1, 0, 0, 0, 1, 1, 0, 1, 1, 1, 0, 1, 0, 1, 1, 1, 1, 0, 0, 0, 1, 1, 0, 1, 1, 1, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 1, 1, 1])
PandasIndex(Index([ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, ... 165, 166, 167, 168, 169, 170, 171, 172, 173, 174], dtype='int64', name='obs_dim_0', length=175))
<xarray.Dataset> Size: 10kB Dimensions: (X_dim_0: 175, X_dim_1: 4, y_dim_0: 175) Coordinates: * X_dim_0 (X_dim_0) int64 1kB 0 1 2 3 4 5 6 7 ... 168 169 170 171 172 173 174 * X_dim_1 (X_dim_1) int64 32B 0 1 2 3 * y_dim_0 (y_dim_0) int64 1kB 0 1 2 3 4 5 6 7 ... 168 169 170 171 172 173 174 Data variables: X (X_dim_0, X_dim_1) float64 6kB 1.0 -0.9747 -1.182 ... 0.1069 0.1065 y (y_dim_0) float64 1kB 1.0 0.0 0.0 1.0 0.0 ... 0.0 0.0 1.0 1.0 1.0 Attributes: created_at: 2025-04-11T13:50:50.332428+00:00 arviz_version: 0.21.0 inference_library: pymc inference_library_version: 5.22.0
array([ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, 174])
array([0, 1, 2, 3])
array([ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, 174])
array([[ 1. , -0.97465, -1.18169, 1.15174], [ 1. , 0.31893, 0.77569, 0.24739], [ 1. , 3.11448, -1.10926, -3.45476], [ 1. , 4.2508 , 0.95688, 4.06752], [ 1. , 0.62606, -0.91338, -0.57183], [ 1. , -1.3313 , -1.06873, 1.4228 ], [ 1. , 2.15916, -0.82468, -1.78062], [ 1. , -0.16888, -3.05686, 0.51625], [ 1. , -0.76584, -0.25754, 0.19723], [ 1. , -1.01102, -1.27116, 1.28517], [ 1. , 0.15744, -0.70449, -0.11092], [ 1. , -1.49652, -0.12493, 0.18696], [ 1. , 0.25195, -1.17936, -0.29714], [ 1. , -1.72056, -1.15562, 1.98832], [ 1. , 2.01127, 3.69879, 7.43927], [ 1. , -2.31482, -2.10299, 4.86805], [ 1. , 1.37555, -0.44607, -0.6136 ], [ 1. , -0.71396, -0.4497 , 0.32107], [ 1. , 3.46658, 2.28206, 7.91093], [ 1. , 0.50269, 3.86492, 1.94285], ... [ 1. , 0.64681, -4.17251, -2.69882], [ 1. , -0.49443, -0.31767, 0.15707], [ 1. , 0.02636, 3.86927, 0.10201], [ 1. , 3.76386, 1.47333, 5.54539], [ 1. , -0.45929, -3.10726, 1.42715], [ 1. , 0.87572, 3.62982, 3.17872], [ 1. , 1.48649, -2.26254, -3.36324], [ 1. , -0.29814, 3.09866, -0.92382], [ 1. , 0.34291, 2.2799 , 0.7818 ], [ 1. , -2.44466, 3.69017, -9.02119], [ 1. , 1.04192, 2.84321, 2.96241], [ 1. , -2.04239, 1.51067, -3.08538], [ 1. , -1.67382, 3.01108, -5.04001], [ 1. , -2.20534, -1.1967 , 2.63914], [ 1. , 0.74943, -1.55202, -1.16314], [ 1. , 2.69419, -2.932 , -7.89937], [ 1. , 0.78122, -3.07909, -2.40544], [ 1. , -5.46008, -1.36414, 7.44833], [ 1. , -0.05884, -1.31435, 0.07733], [ 1. , 0.99617, 0.10688, 0.10647]])
array([1., 0., 0., 1., 0., 1., 0., 1., 0., 1., 1., 0., 0., 1., 1., 1., 1., 0., 1., 1., 0., 0., 1., 1., 0., 0., 1., 0., 1., 1., 0., 1., 0., 1., 1., 1., 0., 1., 0., 0., 0., 1., 1., 1., 0., 1., 1., 1., 0., 0., 0., 1., 1., 0., 0., 0., 1., 0., 0., 1., 1., 0., 1., 0., 0., 0., 0., 0., 1., 1., 0., 1., 0., 1., 0., 1., 1., 0., 0., 1., 0., 1., 0., 1., 0., 0., 0., 1., 0., 0., 1., 0., 1., 0., 1., 1., 0., 1., 1., 0., 1., 0., 1., 0., 1., 0., 0., 1., 0., 0., 1., 1., 0., 0., 0., 0., 1., 0., 1., 1., 0., 0., 0., 0., 0., 1., 1., 1., 1., 0., 0., 1., 1., 1., 0., 1., 0., 0., 0., 1., 1., 0., 1., 1., 1., 0., 1., 0., 1., 1., 1., 1., 0., 0., 0., 1., 1., 0., 1., 1., 1., 0., 0., 0., 0., 1., 0., 0., 1., 0., 0., 0., 1., 1., 1.])
PandasIndex(Index([ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, ... 165, 166, 167, 168, 169, 170, 171, 172, 173, 174], dtype='int64', name='X_dim_0', length=175))
PandasIndex(Index([0, 1, 2, 3], dtype='int64', name='X_dim_1'))
PandasIndex(Index([ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, ... 165, 166, 167, 168, 169, 170, 171, 172, 173, 174], dtype='int64', name='y_dim_0', length=175))
<xarray.Dataset> Size: 6MB Dimensions: (chain: 4, draw: 1000, coeffs: 4, p_dim_0: 175) Coordinates: * chain (chain) int64 32B 0 1 2 3 * draw (draw) int64 8kB 0 1 2 3 4 5 6 7 ... 993 994 995 996 997 998 999 * coeffs (coeffs) <U9 144B 'Intercept' 'x1' 'x2' 'x1:x2' * p_dim_0 (p_dim_0) int64 1kB 0 1 2 3 4 5 6 7 ... 168 169 170 171 172 173 174 Data variables: b (chain, draw, coeffs) float64 128kB -0.5695 1.461 ... -1.73 3.145 p (chain, draw, p_dim_0) float64 6MB 0.9187 0.3723 ... 0.8316 0.6381 Attributes: created_at: 2025-04-11T13:50:50.322398+00:00 arviz_version: 0.21.0 inference_library: pymc inference_library_version: 5.22.0 sampling_time: 0.42817115783691406 tuning_steps: 1000
array([0, 1, 2, 3])
array([ 0, 1, 2, ..., 997, 998, 999], shape=(1000,))
array(['Intercept', 'x1', 'x2', 'x1:x2'], dtype='<U9')
array([ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, 174])
array([[[-0.5695 , 1.46066, -1.32844, 2.47237], [-0.91906, 1.21047, -1.96817, 2.49658], [-0.86849, 1.06545, -1.81086, 3.14778], ..., [-0.9169 , 1.37703, -1.67935, 2.74955], [-1.11022, 1.74579, -1.97351, 3.23752], [-0.72192, 0.98898, -1.48822, 2.11274]], [[-0.85331, 1.18927, -1.57627, 2.53874], [-1.37937, 1.057 , -1.58756, 2.42398], [-1.18949, 1.09326, -1.89909, 2.81857], ..., [-1.15542, 1.27359, -2.23515, 3.09038], [-0.80025, 1.38231, -1.30632, 2.27614], [-1.07163, 1.25889, -1.52186, 2.67609]], [[-0.45987, 1.31232, -1.70091, 3.13744], [-0.46152, 1.48017, -1.71725, 3.56678], [-0.89999, 1.50536, -1.65763, 2.46137], ..., [-0.92148, 1.38658, -1.68688, 2.85536], [-0.59091, 0.93949, -1.24693, 2.0211 ], [-1.05733, 1.74925, -2.19572, 3.20408]], [[-1.20406, 1.70135, -2.06492, 3.14836], [-1.45473, 1.67529, -2.34104, 3.69555], [-0.86138, 1.43605, -1.31106, 2.87827], ..., [-1.41904, 1.21938, -1.73175, 2.73894], [-0.33409, 1.19127, -1.389 , 2.24063], [-0.84561, 1.26785, -1.73035, 3.14513]]], shape=(4, 1000, 4))
array([[[0.91865, 0.37228, 0.0436 , ..., 0.99999, 0.78276, 0.7324 ], [0.95699, 0.19123, 0.02683, ..., 1. , 0.85688, 0.58473], [0.97933, 0.23965, 0.00163, ..., 1. , 0.84453, 0.58285], ..., [0.94746, 0.24971, 0.01387, ..., 1. , 0.80565, 0.63833], [0.96264, 0.21698, 0.0093 , ..., 1. , 0.83635, 0.68193], [0.92457, 0.26149, 0.03592, ..., 0.99999, 0.79238, 0.58155]], [[0.94127, 0.25566, 0.01519, ..., 1. , 0.79328, 0.60664], [0.90536, 0.15789, 0.00901, ..., 1. , 0.69688, 0.44077], [0.96214, 0.16567, 0.00443, ..., 1. , 0.81157, 0.49918], ..., [0.9782 , 0.15207, 0.00456, ..., 1. , 0.87506, 0.55068], [0.88264, 0.30798, 0.05168, ..., 0.99997, 0.7333 , 0.66362], [0.92969, 0.23351, 0.00894, ..., 1. , 0.74298, 0.57559]], [[0.97986, 0.35789, 0.00484, ..., 1. , 0.87448, 0.73099], [0.9857 , 0.39196, 0.00189, ..., 1. , 0.87914, 0.77016], [0.91882, 0.25035, 0.05334, ..., 0.99999, 0.79907, 0.66474], ..., [0.95298, 0.25325, 0.00999, ..., 1. , 0.80767, 0.64187], [0.90844, 0.31897, 0.03682, ..., 0.99998, 0.75933, 0.60513], [0.97133, 0.19624, 0.01416, ..., 1. , 0.87799, 0.68819]], [[0.96098, 0.18478, 0.01108, ..., 1. , 0.83934, 0.64686], [0.98083, 0.13918, 0.00165, ..., 1. , 0.85929, 0.58841], [0.93107, 0.32998, 0.00755, ..., 1. , 0.73104, 0.67601], ..., [0.93044, 0.15501, 0.00569, ..., 1. , 0.7305 , 0.47557], [0.93859, 0.3829 , 0.05604, ..., 0.99999, 0.83128, 0.71965], [0.97303, 0.26788, 0.00289, ..., 1. , 0.83164, 0.63814]]], shape=(4, 1000, 175))
PandasIndex(Index([0, 1, 2, 3], dtype='int64', name='chain'))
PandasIndex(Index([ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, ... 990, 991, 992, 993, 994, 995, 996, 997, 998, 999], dtype='int64', name='draw', length=1000))
PandasIndex(Index(['Intercept', 'x1', 'x2', 'x1:x2'], dtype='object', name='coeffs'))
PandasIndex(Index([ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, ... 165, 166, 167, 168, 169, 170, 171, 172, 173, 174], dtype='int64', name='p_dim_0', length=175))
<xarray.Dataset> Size: 5MB Dimensions: (chain: 4, draw: 1000, obs_dim_0: 75, p_dim_0: 75) Coordinates: * chain (chain) int64 32B 0 1 2 3 * draw (draw) int64 8kB 0 1 2 3 4 5 6 7 ... 993 994 995 996 997 998 999 * obs_dim_0 (obs_dim_0) int64 600B 0 1 2 3 4 5 6 7 ... 68 69 70 71 72 73 74 * p_dim_0 (p_dim_0) int64 600B 0 1 2 3 4 5 6 7 ... 67 68 69 70 71 72 73 74 Data variables: obs (chain, draw, obs_dim_0) int64 2MB 1 1 1 0 0 1 1 ... 0 1 1 1 1 1 p (chain, draw, p_dim_0) float64 2MB 1.0 0.5534 ... 0.9914 0.9105 Attributes: created_at: 2025-04-11T13:50:51.299885+00:00 arviz_version: 0.21.0 inference_library: pymc inference_library_version: 5.22.0
array([0, 1, 2, 3])
array([ 0, 1, 2, ..., 997, 998, 999], shape=(1000,))
array([ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74])
array([ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74])
array([[[1, 1, 1, ..., 0, 1, 1], [1, 1, 1, ..., 0, 1, 1], [1, 0, 1, ..., 0, 1, 1], ..., [1, 0, 1, ..., 0, 1, 1], [1, 1, 1, ..., 0, 1, 1], [1, 1, 1, ..., 0, 1, 1]], [[1, 1, 1, ..., 0, 1, 1], [1, 1, 1, ..., 0, 1, 1], [1, 1, 1, ..., 0, 0, 1], ..., [1, 1, 1, ..., 0, 1, 1], [1, 0, 1, ..., 0, 1, 0], [1, 1, 1, ..., 0, 1, 1]], [[1, 1, 1, ..., 0, 1, 1], [1, 1, 1, ..., 0, 1, 1], [1, 1, 1, ..., 0, 1, 1], ..., [1, 0, 1, ..., 0, 1, 1], [1, 0, 1, ..., 0, 1, 1], [1, 1, 1, ..., 0, 1, 0]], [[1, 0, 1, ..., 0, 1, 0], [1, 1, 1, ..., 0, 1, 1], [1, 1, 1, ..., 0, 1, 0], ..., [1, 0, 1, ..., 0, 1, 1], [1, 0, 1, ..., 1, 1, 0], [1, 0, 1, ..., 1, 1, 1]]], shape=(4, 1000, 75))
array([[[1. , 0.5534 , 0.99997, ..., 0.04798, 0.98781, 0.83179], [1. , 0.43412, 0.99951, ..., 0.02732, 0.8892 , 0.8916 ], [1. , 0.42658, 0.99999, ..., 0.02757, 0.98655, 0.92486], ..., [1. , 0.456 , 0.99996, ..., 0.02707, 0.97784, 0.86575], [1. , 0.4572 , 0.99999, ..., 0.01317, 0.98974, 0.88925], [1. , 0.45297, 0.99911, ..., 0.05496, 0.9066 , 0.8416 ]], [[1. , 0.44681, 0.99989, ..., 0.0362 , 0.96556, 0.85725], [1. , 0.30787, 0.99958, ..., 0.0241 , 0.90953, 0.78316], [1. , 0.35433, 0.99988, ..., 0.02099, 0.94319, 0.8858 ], ..., [1. , 0.38512, 0.99994, ..., 0.01484, 0.94703, 0.92505], [1. , 0.48556, 0.99988, ..., 0.04326, 0.97284, 0.77936], [1. , 0.40242, 0.99995, ..., 0.02782, 0.97667, 0.82692]], [[1. , 0.56084, 1. , ..., 0.03811, 0.9947 , 0.93348], [1. , 0.58213, 1. , ..., 0.02997, 0.99864, 0.94473], [1. , 0.47758, 0.99987, ..., 0.02846, 0.95958, 0.83019], ..., [1. , 0.45605, 0.99998, ..., 0.0258 , 0.98332, 0.87344], [1. , 0.47862, 0.99938, ..., 0.07478, 0.94029, 0.81928], [1. , 0.47123, 0.99999, ..., 0.01233, 0.98042, 0.91298]], [[1. , 0.42841, 0.99999, ..., 0.01202, 0.98052, 0.88654], [1. , 0.36514, 1. , ..., 0.00679, 0.98849, 0.92282], [1. , 0.47694, 0.99999, ..., 0.03262, 0.99501, 0.82812], ..., [1. , 0.31804, 0.9999 , ..., 0.01762, 0.95004, 0.81882], [1. , 0.57604, 0.99984, ..., 0.07195, 0.9711 , 0.87117], [1. , 0.45888, 0.99999, ..., 0.02638, 0.99137, 0.91052]]], shape=(4, 1000, 75))
PandasIndex(Index([0, 1, 2, 3], dtype='int64', name='chain'))
PandasIndex(Index([ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, ... 990, 991, 992, 993, 994, 995, 996, 997, 998, 999], dtype='int64', name='draw', length=1000))
PandasIndex(Index([ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74], dtype='int64', name='obs_dim_0'))
PandasIndex(Index([ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74], dtype='int64', name='p_dim_0'))
<xarray.Dataset> Size: 496kB Dimensions: (chain: 4, draw: 1000) Coordinates: * chain (chain) int64 32B 0 1 2 3 * draw (draw) int64 8kB 0 1 2 3 4 5 ... 995 996 997 998 999 Data variables: (12/17) acceptance_rate (chain, draw) float64 32kB 0.4819 0.7555 ... 0.7986 diverging (chain, draw) bool 4kB False False ... False False energy (chain, draw) float64 32kB 60.19 57.69 ... 57.79 energy_error (chain, draw) float64 32kB 0.0 0.6809 ... 0.02024 index_in_trajectory (chain, draw) int64 32kB 0 -4 -2 -1 2 ... 1 3 -6 3 -3 largest_eigval (chain, draw) float64 32kB nan nan nan ... nan nan ... ... process_time_diff (chain, draw) float64 32kB 8.7e-05 ... 0.000219 reached_max_treedepth (chain, draw) bool 4kB False False ... False False smallest_eigval (chain, draw) float64 32kB nan nan nan ... nan nan step_size (chain, draw) float64 32kB 0.4638 0.4638 ... 0.4466 step_size_bar (chain, draw) float64 32kB 0.4786 0.4786 ... 0.4723 tree_depth (chain, draw) int64 32kB 2 3 2 3 4 2 ... 3 3 3 3 4 4 Attributes: created_at: 2025-04-11T13:50:50.328894+00:00 arviz_version: 0.21.0 inference_library: pymc inference_library_version: 5.22.0 sampling_time: 0.42817115783691406 tuning_steps: 1000
array([0, 1, 2, 3])
array([ 0, 1, 2, ..., 997, 998, 999], shape=(1000,))
array([[0.48185, 0.75548, 1. , ..., 0.6928 , 0.85403, 0.81717], [0.99205, 0.64292, 0.88393, ..., 1. , 0.79153, 1. ], [0.83282, 0.87441, 0.8058 , ..., 1. , 0.98665, 0.10584], [0.4735 , 0.62884, 0.8561 , ..., 0.77434, 0.94339, 0.7986 ]], shape=(4, 1000))
array([[False, False, False, ..., False, False, False], [False, False, False, ..., False, False, False], [False, False, False, ..., False, False, False], [False, False, False, ..., False, False, False]], shape=(4, 1000))
array([[60.18647, 57.69275, 57.48299, ..., 55.87092, 56.36287, 56.67249], [54.74467, 57.01666, 58.47333, ..., 56.62219, 57.55791, 55.61526], [58.45947, 59.80052, 60.26114, ..., 54.8342 , 54.78261, 59.76395], [58.19455, 61.26769, 58.50347, ..., 57.05287, 58.14855, 57.78647]], shape=(4, 1000))
array([[ 0. , 0.68094, -0.33188, ..., -0.08163, 0.0724 , -0.00224], [-0.02653, 0.35912, -0.03844, ..., -0.06479, -1.11556, -0.18342], [ 0.27132, 0.44647, -1.232 , ..., -0.08708, 0.02903, 0.58175], [ 0. , 0.33049, 0.23939, ..., 0.00731, 0.18652, 0.02024]], shape=(4, 1000))
array([[ 0, -4, -2, ..., -3, -5, 6], [ 1, -2, -2, ..., -4, -4, 2], [-4, 1, -2, ..., -2, -5, 4], [ 0, -5, 5, ..., -6, 3, -3]], shape=(4, 1000))
array([[nan, nan, nan, ..., nan, nan, nan], [nan, nan, nan, ..., nan, nan, nan], [nan, nan, nan, ..., nan, nan, nan], [nan, nan, nan, ..., nan, nan, nan]], shape=(4, 1000))
array([[-55.61979, -56.61982, -56.34389, ..., -53.86998, -54.92231, -54.76066], [-53.75155, -56.46697, -55.65965, ..., -56.40062, -55.11841, -54.26766], [-56.34953, -58.75698, -55.45519, ..., -53.97488, -54.36662, -55.91831], [-54.98731, -56.66002, -55.91184, ..., -55.85943, -55.95399, -55.30691]], shape=(4, 1000))
array([[ 1.52859, 0.68094, -0.82933, ..., 0.91573, 0.22896, 0.60845], [-0.02653, 0.65449, 0.42802, ..., -0.34745, 1.19951, -0.24978], [ 0.39346, -0.98629, -1.70315, ..., -0.10375, 0.05023, 73.09179], [ 1.00243, 0.68934, 0.44313, ..., 0.7909 , -0.31329, 1.43742]], shape=(4, 1000))
array([[ 3., 7., 3., ..., 7., 7., 11.], [15., 7., 3., ..., 7., 11., 7.], [15., 7., 7., ..., 11., 11., 11.], [ 3., 7., 7., ..., 7., 11., 11.]], shape=(4, 1000))
array([[0.00009, 0.00016, 0.00008, ..., 0.00015, 0.00015, 0.00023], [0.0003 , 0.00015, 0.00008, ..., 0.00016, 0.00023, 0.00015], [0.0003 , 0.00015, 0.00015, ..., 0.00026, 0.00026, 0.00028], [0.00008, 0.00015, 0.00015, ..., 0.00017, 0.00022, 0.00022]], shape=(4, 1000))
array([[45128.01884, 45128.01895, 45128.01915, ..., 45128.19928, 45128.19945, 45128.19963], [45128.0227 , 45128.02304, 45128.02321, ..., 45128.20326, 45128.20345, 45128.2037 ], [45128.0201 , 45128.02043, 45128.02061, ..., 45128.20371, 45128.20401, 45128.20623], [45128.02341, 45128.02352, 45128.0237 , ..., 45128.20623, 45128.20642, 45128.20666]], shape=(4, 1000))
array([[0.00009, 0.00016, 0.00008, ..., 0.00015, 0.00015, 0.00023], [0.0003 , 0.00015, 0.00008, ..., 0.00016, 0.00023, 0.00015], [0.0003 , 0.00015, 0.00015, ..., 0.00027, 0.00026, 0.00028], [0.00008, 0.00016, 0.00015, ..., 0.00017, 0.00022, 0.00022]], shape=(4, 1000))
array([[False, False, False, ..., False, False, False], [False, False, False, ..., False, False, False], [False, False, False, ..., False, False, False], [False, False, False, ..., False, False, False]], shape=(4, 1000))
array([[nan, nan, nan, ..., nan, nan, nan], [nan, nan, nan, ..., nan, nan, nan], [nan, nan, nan, ..., nan, nan, nan], [nan, nan, nan, ..., nan, nan, nan]], shape=(4, 1000))
array([[0.46383, 0.46383, 0.46383, ..., 0.46383, 0.46383, 0.46383], [0.36179, 0.36179, 0.36179, ..., 0.36179, 0.36179, 0.36179], [0.38215, 0.38215, 0.38215, ..., 0.38215, 0.38215, 0.38215], [0.4466 , 0.4466 , 0.4466 , ..., 0.4466 , 0.4466 , 0.4466 ]], shape=(4, 1000))
array([[0.47863, 0.47863, 0.47863, ..., 0.47863, 0.47863, 0.47863], [0.44534, 0.44534, 0.44534, ..., 0.44534, 0.44534, 0.44534], [0.47785, 0.47785, 0.47785, ..., 0.47785, 0.47785, 0.47785], [0.47232, 0.47232, 0.47232, ..., 0.47232, 0.47232, 0.47232]], shape=(4, 1000))
array([[2, 3, 2, ..., 3, 3, 4], [4, 3, 2, ..., 3, 4, 3], [4, 3, 3, ..., 4, 4, 4], [2, 3, 3, ..., 3, 4, 4]], shape=(4, 1000))
PandasIndex(Index([0, 1, 2, 3], dtype='int64', name='chain'))
PandasIndex(Index([ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, ... 990, 991, 992, 993, 994, 995, 996, 997, 998, 999], dtype='int64', name='draw', length=1000))
<xarray.Dataset> Size: 3kB Dimensions: (obs_dim_0: 175) Coordinates: * obs_dim_0 (obs_dim_0) int64 1kB 0 1 2 3 4 5 6 ... 169 170 171 172 173 174 Data variables: obs (obs_dim_0) int64 1kB 1 0 0 1 0 1 0 1 0 1 ... 1 0 0 1 0 0 0 1 1 1 Attributes: created_at: 2025-04-11T13:50:50.331861+00:00 arviz_version: 0.21.0 inference_library: pymc inference_library_version: 5.22.0
array([ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, 174])
array([1, 0, 0, 1, 0, 1, 0, 1, 0, 1, 1, 0, 0, 1, 1, 1, 1, 0, 1, 1, 0, 0, 1, 1, 0, 0, 1, 0, 1, 1, 0, 1, 0, 1, 1, 1, 0, 1, 0, 0, 0, 1, 1, 1, 0, 1, 1, 1, 0, 0, 0, 1, 1, 0, 0, 0, 1, 0, 0, 1, 1, 0, 1, 0, 0, 0, 0, 0, 1, 1, 0, 1, 0, 1, 0, 1, 1, 0, 0, 1, 0, 1, 0, 1, 0, 0, 0, 1, 0, 0, 1, 0, 1, 0, 1, 1, 0, 1, 1, 0, 1, 0, 1, 0, 1, 0, 0, 1, 0, 0, 1, 1, 0, 0, 0, 0, 1, 0, 1, 1, 0, 0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 1, 1, 1, 0, 1, 0, 0, 0, 1, 1, 0, 1, 1, 1, 0, 1, 0, 1, 1, 1, 1, 0, 0, 0, 1, 1, 0, 1, 1, 1, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 1, 1, 1])
PandasIndex(Index([ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, ... 165, 166, 167, 168, 169, 170, 171, 172, 173, 174], dtype='int64', name='obs_dim_0', length=175))
<xarray.Dataset> Size: 10kB Dimensions: (X_dim_0: 175, X_dim_1: 4, y_dim_0: 175) Coordinates: * X_dim_0 (X_dim_0) int64 1kB 0 1 2 3 4 5 6 7 ... 168 169 170 171 172 173 174 * X_dim_1 (X_dim_1) int64 32B 0 1 2 3 * y_dim_0 (y_dim_0) int64 1kB 0 1 2 3 4 5 6 7 ... 168 169 170 171 172 173 174 Data variables: X (X_dim_0, X_dim_1) float64 6kB 1.0 -0.9747 -1.182 ... 0.1069 0.1065 y (y_dim_0) float64 1kB 1.0 0.0 0.0 1.0 0.0 ... 0.0 0.0 1.0 1.0 1.0 Attributes: created_at: 2025-04-11T13:50:50.332428+00:00 arviz_version: 0.21.0 inference_library: pymc inference_library_version: 5.22.0
array([ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, 174])
array([0, 1, 2, 3])
array([ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, 174])
array([[ 1. , -0.97465, -1.18169, 1.15174], [ 1. , 0.31893, 0.77569, 0.24739], [ 1. , 3.11448, -1.10926, -3.45476], [ 1. , 4.2508 , 0.95688, 4.06752], [ 1. , 0.62606, -0.91338, -0.57183], [ 1. , -1.3313 , -1.06873, 1.4228 ], [ 1. , 2.15916, -0.82468, -1.78062], [ 1. , -0.16888, -3.05686, 0.51625], [ 1. , -0.76584, -0.25754, 0.19723], [ 1. , -1.01102, -1.27116, 1.28517], [ 1. , 0.15744, -0.70449, -0.11092], [ 1. , -1.49652, -0.12493, 0.18696], [ 1. , 0.25195, -1.17936, -0.29714], [ 1. , -1.72056, -1.15562, 1.98832], [ 1. , 2.01127, 3.69879, 7.43927], [ 1. , -2.31482, -2.10299, 4.86805], [ 1. , 1.37555, -0.44607, -0.6136 ], [ 1. , -0.71396, -0.4497 , 0.32107], [ 1. , 3.46658, 2.28206, 7.91093], [ 1. , 0.50269, 3.86492, 1.94285], ... [ 1. , 0.64681, -4.17251, -2.69882], [ 1. , -0.49443, -0.31767, 0.15707], [ 1. , 0.02636, 3.86927, 0.10201], [ 1. , 3.76386, 1.47333, 5.54539], [ 1. , -0.45929, -3.10726, 1.42715], [ 1. , 0.87572, 3.62982, 3.17872], [ 1. , 1.48649, -2.26254, -3.36324], [ 1. , -0.29814, 3.09866, -0.92382], [ 1. , 0.34291, 2.2799 , 0.7818 ], [ 1. , -2.44466, 3.69017, -9.02119], [ 1. , 1.04192, 2.84321, 2.96241], [ 1. , -2.04239, 1.51067, -3.08538], [ 1. , -1.67382, 3.01108, -5.04001], [ 1. , -2.20534, -1.1967 , 2.63914], [ 1. , 0.74943, -1.55202, -1.16314], [ 1. , 2.69419, -2.932 , -7.89937], [ 1. , 0.78122, -3.07909, -2.40544], [ 1. , -5.46008, -1.36414, 7.44833], [ 1. , -0.05884, -1.31435, 0.07733], [ 1. , 0.99617, 0.10688, 0.10647]])
array([1., 0., 0., 1., 0., 1., 0., 1., 0., 1., 1., 0., 0., 1., 1., 1., 1., 0., 1., 1., 0., 0., 1., 1., 0., 0., 1., 0., 1., 1., 0., 1., 0., 1., 1., 1., 0., 1., 0., 0., 0., 1., 1., 1., 0., 1., 1., 1., 0., 0., 0., 1., 1., 0., 0., 0., 1., 0., 0., 1., 1., 0., 1., 0., 0., 0., 0., 0., 1., 1., 0., 1., 0., 1., 0., 1., 1., 0., 0., 1., 0., 1., 0., 1., 0., 0., 0., 1., 0., 0., 1., 0., 1., 0., 1., 1., 0., 1., 1., 0., 1., 0., 1., 0., 1., 0., 0., 1., 0., 0., 1., 1., 0., 0., 0., 0., 1., 0., 1., 1., 0., 0., 0., 0., 0., 1., 1., 1., 1., 0., 0., 1., 1., 1., 0., 1., 0., 0., 0., 1., 1., 0., 1., 1., 1., 0., 1., 0., 1., 1., 1., 1., 0., 0., 0., 1., 1., 0., 1., 1., 1., 0., 0., 0., 0., 1., 0., 0., 1., 0., 0., 0., 1., 1., 1.])
PandasIndex(Index([ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, ... 165, 166, 167, 168, 169, 170, 171, 172, 173, 174], dtype='int64', name='X_dim_0', length=175))
PandasIndex(Index([0, 1, 2, 3], dtype='int64', name='X_dim_1'))
PandasIndex(Index([ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, ... 165, 166, 167, 168, 169, 170, 171, 172, 173, 174], dtype='int64', name='y_dim_0', length=175))
mean | sd | hdi_3% | hdi_97% | mcse_mean | mcse_sd | ess_bulk | ess_tail | r_hat | |
---|---|---|---|---|---|---|---|---|---|
obs[0] | 1.000 | 0.000 | 1.000 | 1.000 | 0.000 | NaN | 4000.0 | 4000.0 | NaN |
obs[1] | 0.454 | 0.498 | 0.000 | 1.000 | 0.008 | 0.001 | 3987.0 | 3987.0 | 1.0 |
obs[2] | 0.999 | 0.027 | 1.000 | 1.000 | 0.000 | 0.008 | 4021.0 | 4000.0 | 1.0 |
obs[3] | 0.485 | 0.500 | 0.000 | 1.000 | 0.008 | 0.000 | 3785.0 | 3785.0 | 1.0 |
obs[4] | 0.008 | 0.088 | 0.000 | 0.000 | 0.001 | 0.008 | 4078.0 | 4078.0 | 1.0 |
... | ... | ... | ... | ... | ... | ... | ... | ... | ... |
p[70] | 0.577 | 0.109 | 0.374 | 0.782 | 0.002 | 0.001 | 3240.0 | 2810.0 | 1.0 |
p[71] | 0.995 | 0.008 | 0.983 | 1.000 | 0.000 | 0.000 | 2655.0 | 2907.0 | 1.0 |
p[72] | 0.038 | 0.027 | 0.003 | 0.087 | 0.001 | 0.001 | 953.0 | 1377.0 | 1.0 |
p[73] | 0.965 | 0.035 | 0.903 | 1.000 | 0.001 | 0.001 | 2377.0 | 2163.0 | 1.0 |
p[74] | 0.856 | 0.057 | 0.741 | 0.947 | 0.001 | 0.001 | 2679.0 | 2752.0 | 1.0 |
150 rows × 9 columns
<xarray.DataArray 'p' (p_dim_0: 175)> Size: 1kB
array([0.93819, 0.26132, 0.01864, 0.99999, 0.4655 , 0.94175, 0.18459, 0.99135,
0.28936, 0.95823, 0.53909, 0.12185, 0.63173, 0.97815, 1. , 0.99997,
0.48929, 0.44769, 1. , 0.25201, 0.41885, 0.00006, 0.63208, 1. ,
0. , 0.00025, 0.99912, 0.21269, 0.85564, 0.87999, 0.00411, 0.90838,
0.00001, 0.58379, 0.90272, 0.91664, 0.00165, 0.85988, 0.09589, 0. ,
0.00006, 0.86009, 1. , 0.99999, 0.6737 , 0.47217, 0.99937, 0.39814,
0.64579, 0.11999, 0.44915, 0.17473, 0.8131 , 0. , 0.04294, 0.19902,
0.64672, 0.06343, 0.14008, 1. , 1. , 0. , 0.96862, 0.00049,
0.00011, 0.48045, 0.04294, 0.00011, 1. , 1. , 0.00125, 0.5352 ,
0.43427, 0.99984, 0.00117, 0.99389, 0.80949, 0.40137, 0.00007, 1. ,
0.21644, 0.302 , 0.64459, 0.84646, 0.00032, 0.00032, 0.21478, 0.99995,
0. , 0.00174, 0.29865, 0.48853, 0.84389, 0.00308, 0.99328, 0.68351,
0.0127 , 0.99999, 1. , 0.00036, 0.99944, 0.92848, 0.40274, 0.03276,
0.99735, 0.00578, 0.0001 , 1. , 0.05347, 0.00139, 0.82088, 0.94333,
0.0212 , 0.00001, 0.00001, 0.82958, 0.99836, 0.29717, 1. , 0.9247 ,
0.00946, 0. , 0.0855 , 0.94712, 0.41086, 0.99915, 1. , 0.42349,
0.99999, 0.12598, 0.00345, 0.61756, 0.84217, 0.99998, 0.08445, 0.77662,
0.00063, 0.00373, 0.45406, 0.56222, 0.99155, 0.71999, 0.99996, 1. ,
0.55747, 0.18935, 0.90859, 0.40357, 0.86634, 0.91812, 0.36738, 0.96028,
0.00303, 0.11039, 0.05068, 0.38197, 0.36004, 0.00267, 1. , 0.99857,
0.92466, 0.01816, 0.00052, 0.13198, 0. , 0.96729, 0.00001, 0. ,
0.99188, 0.37199, 0.00001, 0.22199, 0.99999, 0.79222, 0.6226 ])
Coordinates:
* p_dim_0 (p_dim_0) int64 1kB 0 1 2 3 4 5 6 7 ... 168 169 170 171 172 173 174
<xarray.DataArray 'p' (p_dim_0: 75)> Size: 600B
array([1. , 0.45196, 0.99975, 0.46804, 0.00615, 1. , 0.98427, 0.0004 ,
0.99558, 0.08307, 0.17285, 0.78742, 0.99932, 0.9984 , 0.11223, 0.00537,
1. , 0.99499, 1. , 0. , 1. , 0. , 0.00011, 0.00268,
0.99795, 0.08286, 0. , 0.36999, 0.88805, 0.76588, 0.91828, 0.48579,
0.80057, 0.95772, 0.21037, 0.00643, 0. , 0.98847, 0.032 , 0.70961,
0.21745, 0.1475 , 0.00636, 0.00013, 0.054 , 0.06816, 0.49145, 0. ,
0.55927, 0. , 0.19585, 0.99921, 0.00419, 0.00002, 0.08313, 1. ,
0. , 0.73422, 1. , 1. , 0.99977, 0. , 0.48587, 0.68699,
0.92828, 0.43828, 0.99233, 0.01992, 0.99996, 0. , 0.57684, 0.99494,
0.03784, 0.96468, 0.8558 ])
Coordinates:
* p_dim_0 (p_dim_0) int64 600B 0 1 2 3 4 5 6 7 8 ... 67 68 69 70 71 72 73 74
Sta 663 - Spring 2025