diff --git a/bambi/backend/pymc.py b/bambi/backend/pymc.py index 7e879917..311a8b94 100644 --- a/bambi/backend/pymc.py +++ b/bambi/backend/pymc.py @@ -3,7 +3,6 @@ import operator import traceback import warnings - from copy import deepcopy from importlib.metadata import version @@ -11,13 +10,19 @@ import pymc as pm import pytensor.tensor as pt import xarray as xr - from pymc.backends.arviz import coords_and_dims_for_inferencedata, find_observations from pymc.util import get_default_varnames from pytensor.tensor.special import softmax from bambi.backend.inference_methods import inference_methods -from bambi.backend.links import cloglog, identity, inverse_squared, logit, probit, arctan_2 +from bambi.backend.links import ( + arctan_2, + cloglog, + identity, + inverse_squared, + logit, + probit, +) from bambi.backend.model_components import ( ConstantComponent, DistributionalComponent, @@ -246,6 +251,17 @@ def _run_mcmc( import bayeux as bx # pylint: disable=import-outside-toplevel import jax # pylint: disable=import-outside-toplevel + # pylint: disable=import-outside-toplevel + from pymc.sampling.parallel import ( + _cpu_count, + ) + + # handle case where cores and chains are not provided + if cores is None: + cores = min(4, _cpu_count()) + if chains is None: + chains = max(2, cores) + # Set the seed for reproducibility if provided if random_seed is not None: if not isinstance(random_seed, int): @@ -255,10 +271,20 @@ def _run_mcmc( jax_seed = jax.random.PRNGKey(np.random.randint(2**31 - 1)) bx_model = bx.Model.from_pymc(self.model) - bx_sampler = operator.attrgetter(sampler_backend)( - bx_model.mcmc # pylint: disable=no-member + # pylint: disable=no-member + bx_sampler = operator.attrgetter(sampler_backend)(bx_model.mcmc) + + # We pass 'draws', 'tune', 'chains', and 'cores' because they can be used by some + # samplers. Since those are keyword arguments of `Model.fit()`, they would not + # be passed in the `kwargs` dict. + idata = bx_sampler( + seed=jax_seed, + draws=draws, + tune=tune, + chains=chains, + cores=cores, + **kwargs, ) - idata = bx_sampler(seed=jax_seed, **kwargs) idata_from = "bayeux" else: raise ValueError( @@ -494,7 +520,10 @@ def create_posterior_bayeux(posterior, pm_model): # https://docs.xarray.dev/en/stable/generated/xarray.Dataset.html data_vars_values = {} for data_var_name, data_var_dims in data_vars_dims.items(): - data_vars_values[data_var_name] = (data_var_dims, posterior[data_var_name].to_numpy()) + data_vars_values[data_var_name] = ( + data_var_dims, + posterior[data_var_name].to_numpy(), + ) # Get coords dims_in_use = set(dim for dims in data_vars_dims.values() for dim in dims) diff --git a/conda-envs/environment-dev.yml b/conda-envs/environment-dev.yml new file mode 100644 index 00000000..b0aa377c --- /dev/null +++ b/conda-envs/environment-dev.yml @@ -0,0 +1,24 @@ +name: bambi-env +channels: + - conda-forge + - defaults +dependencies: + - python>=3.10,<3.13 + - arviz>=0.12.0 + - formulae>=0.5.3 + - graphviz + - pandas>=1.0.0 + - pymc>=5.16.1 + # Dev dependencies + - black=24.3.0 + - ipython>=5.8.0,!=8.7.0 + - pre-commit>=2.19 + - pylint=3.1.0 + - pytest-cov>=2.6.1 + - pytest>=4.4.0 + - seaborn>=0.9.0 + - pip + - watermark + - pip: + - quartodoc==0.6.1 + - bayeux-ml==0.1.15 # Optional JAX dependency diff --git a/docs/notebooks/alternative_samplers.ipynb b/docs/notebooks/alternative_samplers.ipynb index bfe314d8..88728c41 100644 --- a/docs/notebooks/alternative_samplers.ipynb +++ b/docs/notebooks/alternative_samplers.ipynb @@ -21,7 +21,6 @@ "source": [ "import arviz as az\n", "import bambi as bmb\n", - "import bayeux as bx\n", "import numpy as np\n", "import pandas as pd" ] @@ -30,11 +29,11 @@ "cell_type": "markdown", "metadata": {}, "source": [ - "## bayeux\n", + "## Bayeux\n", "\n", - "Bambi leverages `bayeux` to access different sampling backends. In short, `bayeux` lets you write a probabilistic model in JAX and immediately have access to state-of-the-art inference methods. \n", + "Bambi leverages [`bayeux`](https://jax-ml.github.io/bayeux/) to access different sampling backends. In short, `bayeux` lets you write a probabilistic model in JAX and immediately have access to state-of-the-art inference methods.\n", "\n", - "Since the underlying Bambi model is a PyMC model, this PyMC model can be \"given\" to `bayeux`. Then, we can choose from a variety of MCMC methods to perform inference. \n", + "Since the underlying Bambi model is a PyMC model, this PyMC model can be \"given\" to `bayeux`. Then, we can choose from a variety of MCMC methods to perform inference.\n", "\n", "To demonstrate the available backends, we will fist simulate data and build a model." ] @@ -50,11 +49,11 @@ "noise_std = 1.0\n", "random_seed = 42\n", "\n", - "np.random.seed(random_seed)\n", + "rng = np.random.default_rng(random_seed)\n", "\n", - "coefficients = np.random.randn(num_features)\n", - "X = np.random.randn(num_samples, num_features)\n", - "error = np.random.normal(scale=noise_std, size=num_samples)\n", + "coefficients = rng.normal(size=num_features)\n", + "X = rng.normal(size=(num_samples, num_features))\n", + "error = rng.normal(scale=noise_std, size=num_samples)\n", "y = X @ coefficients + error\n", "\n", "data = pd.DataFrame({\"y\": y, \"x\": X.flatten()})" @@ -100,7 +99,8 @@ " 'flowmc_realnvp_hmc',\n", " 'flowmc_realnvp_mala',\n", " 'numpyro_hmc',\n", - " 'numpyro_nuts']}}" + " 'numpyro_nuts',\n", + " 'nutpie']}}" ] }, "execution_count": 4, @@ -169,7 +169,8 @@ " 'flowmc_realnvp_hmc',\n", " 'flowmc_realnvp_mala',\n", " 'numpyro_hmc',\n", - " 'numpyro_nuts']}" + " 'numpyro_nuts',\n", + " 'nutpie']}" ] }, "execution_count": 6, @@ -214,6 +215,13 @@ "execution_count": 7, "metadata": {}, "outputs": [ + { + "name": "stderr", + "output_type": "stream", + "text": [ + "WARNING:2024-12-21 13:43:24,702:jax._src.xla_bridge:969: An NVIDIA GPU may be present on this machine, but a CUDA-enabled jaxlib is not installed. Falling back to cpu.\n" + ] + }, { "data": { "text/html": [ @@ -225,8 +233,8 @@ "
<xarray.Dataset> Size: 100kB\n", "Dimensions: (chain: 8, draw: 500)\n", "Coordinates:\n", - " * chain (chain) int64 64B 0 1 2 3 4 5 6 7\n", " * draw (draw) int64 4kB 0 1 2 3 4 5 6 7 ... 493 494 495 496 497 498 499\n", + " * chain (chain) int64 64B 0 1 2 3 4 5 6 7\n", "Data variables:\n", - " Intercept (chain, draw) float64 32kB -0.01389 0.1089 ... -0.000227 0.1499\n", - " sigma (chain, draw) float64 32kB 1.093 0.8295 1.09 ... 0.8503 0.9044\n", - " x (chain, draw) float64 32kB 0.3531 0.3635 0.3556 ... 0.3502 0.3066\n", + " Intercept (chain, draw) float64 32kB -0.02658 0.09092 ... 0.06874 0.01924\n", + " sigma (chain, draw) float64 32kB 1.083 0.9101 0.9074 ... 0.9316 1.088\n", + " x (chain, draw) float64 32kB 0.2574 0.5978 0.2478 ... 0.5018 0.6094\n", "Attributes:\n", - " created_at: 2024-06-02T15:41:30.853458+00:00\n", - " arviz_version: 0.18.0\n", + " created_at: 2024-12-21T16:43:32.789194+00:00\n", + " arviz_version: 0.19.0\n", " modeling_interface: bambi\n", - " modeling_interface_version: 0.13.1.dev44+g55aac858.d20240602
PandasIndex(Index([0, 1, 2, 3, 4, 5, 6, 7], dtype='int64', name='chain'))
<xarray.Dataset> Size: 26kB\n", "Dimensions: (chain: 4, draw: 250)\n", "Coordinates:\n", - " * chain (chain) int64 32B 0 1 2 3\n", " * draw (draw) int64 2kB 0 1 2 3 4 5 6 7 ... 243 244 245 246 247 248 249\n", + " * chain (chain) int64 32B 0 1 2 3\n", "Data variables:\n", - " Intercept (chain, draw) float64 8kB 0.1186 0.1811 0.1516 ... 0.104 -0.01889\n", - " sigma (chain, draw) float64 8kB 0.9543 0.976 0.9225 ... 0.8462 0.9206\n", - " x (chain, draw) float64 8kB 0.1962 0.2625 0.2581 ... 0.3441 0.3412\n", + " Intercept (chain, draw) float64 8kB -0.1701 0.1002 ... 0.09008 -0.07872\n", + " sigma (chain, draw) float64 8kB 1.024 0.9962 0.9826 ... 0.9153 1.042\n", + " x (chain, draw) float64 8kB 0.468 0.5335 0.4088 ... 0.5823 0.2556\n", "Attributes:\n", - " created_at: 2024-06-02T15:41:41.635714+00:00\n", - " arviz_version: 0.18.0\n", + " created_at: 2024-12-21T16:43:38.392870+00:00\n", + " arviz_version: 0.19.0\n", " modeling_interface: bambi\n", - " modeling_interface_version: 0.13.1.dev44+g55aac858.d20240602
PandasIndex(Index([0, 1, 2, 3], dtype='int64', name='chain'))
<xarray.Dataset> Size: 200kB\n", "Dimensions: (chain: 8, draw: 1000)\n", "Coordinates:\n", - " * chain (chain) int64 64B 0 1 2 3 4 5 6 7\n", " * draw (draw) int64 8kB 0 1 2 3 4 5 6 7 ... 993 994 995 996 997 998 999\n", + " * chain (chain) int64 64B 0 1 2 3 4 5 6 7\n", "Data variables:\n", - " Intercept (chain, draw) float64 64kB 0.2415 -0.0268 ... -0.07376 -0.05367\n", - " sigma (chain, draw) float64 64kB 0.9948 0.9385 0.9726 ... 0.8749 1.129\n", - " x (chain, draw) float64 64kB 0.3051 0.3062 0.1433 ... 0.2551 0.5439\n", + " Intercept (chain, draw) float64 64kB -0.06265 -0.06601 ... 0.08766 0.08766\n", + " sigma (chain, draw) float64 64kB 0.9457 0.9487 0.9521 ... 0.9434 0.9434\n", + " x (chain, draw) float64 64kB 0.3832 0.3474 0.276 ... 0.395 0.395\n", "Attributes:\n", - " created_at: 2024-06-02T15:41:52.350361+00:00\n", - " arviz_version: 0.18.0\n", + " created_at: 2024-12-21T16:43:45.717159+00:00\n", + " arviz_version: 0.19.0\n", " modeling_interface: bambi\n", - " modeling_interface_version: 0.13.1.dev44+g55aac858.d20240602
PandasIndex(Index([0, 1, 2, 3, 4, 5, 6, 7], dtype='int64', name='chain'))
<xarray.Dataset> Size: 200kB\n", "Dimensions: (chain: 8, draw: 1000)\n", "Coordinates:\n", - " * chain (chain) int64 64B 0 1 2 3 4 5 6 7\n", " * draw (draw) int64 8kB 0 1 2 3 4 5 6 7 ... 993 994 995 996 997 998 999\n", + " * chain (chain) int64 64B 0 1 2 3 4 5 6 7\n", "Data variables:\n", - " Intercept (chain, draw) float64 64kB -0.01687 0.06615 ... 0.1263 0.03044\n", - " sigma (chain, draw) float64 64kB 0.965 0.8374 1.078 ... 1.002 0.8794\n", - " x (chain, draw) float64 64kB 0.2405 0.4685 0.2349 ... 0.3402 0.3522\n", + " Intercept (chain, draw) float64 64kB 0.04368 -0.1021 ... -0.00282 0.1476\n", + " sigma (chain, draw) float64 64kB 0.9309 0.9906 0.9233 ... 0.9424 0.9128\n", + " x (chain, draw) float64 64kB 0.6003 0.3584 0.5494 ... 0.3202 0.2671\n", "Attributes:\n", - " created_at: 2024-06-02T15:42:01.224796+00:00\n", - " arviz_version: 0.18.0\n", + " created_at: 2024-12-21T16:43:50.477087+00:00\n", + " arviz_version: 0.19.0\n", " inference_library: numpyro\n", - " inference_library_version: 0.15.0\n", + " inference_library_version: 0.15.3\n", " modeling_interface: bambi\n", - " modeling_interface_version: 0.13.1.dev44+g55aac858.d20240602
PandasIndex(Index([0, 1, 2, 3, 4, 5, 6, 7], dtype='int64', name='chain'))
<xarray.Dataset> Size: 244kB\n", "Dimensions: (chain: 20, draw: 500)\n", "Coordinates:\n", - " * chain (chain) int64 160B 0 1 2 3 4 5 6 7 8 ... 12 13 14 15 16 17 18 19\n", " * draw (draw) int64 4kB 0 1 2 3 4 5 6 7 ... 493 494 495 496 497 498 499\n", + " * chain (chain) int64 160B 0 1 2 3 4 5 6 7 8 ... 12 13 14 15 16 17 18 19\n", "Data variables:\n", - " Intercept (chain, draw) float64 80kB 0.07083 0.06709 ... 0.06182 -0.04028\n", - " sigma (chain, draw) float64 80kB 0.9755 0.9504 0.9298 ... 0.8554 0.9118\n", - " x (chain, draw) float64 80kB 0.382 0.3589 0.2673 ... 0.4581 0.3594\n", + " Intercept (chain, draw) float64 80kB 0.2975 0.2975 ... 0.08134 0.03252\n", + " sigma (chain, draw) float64 80kB 0.97 0.97 1.024 ... 0.9849 0.9851\n", + " x (chain, draw) float64 80kB 0.5371 0.5371 0.5067 ... 0.4151 0.4007\n", "Attributes:\n", - " created_at: 2024-06-02T15:42:49.303545+00:00\n", - " arviz_version: 0.18.0\n", + " created_at: 2024-12-21T16:44:12.534363+00:00\n", + " arviz_version: 0.19.0\n", " modeling_interface: bambi\n", - " modeling_interface_version: 0.13.1.dev44+g55aac858.d20240602
PandasIndex(Index([0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19], dtype='int64', name='chain'))
\n", - " | mean | \n", - "sd | \n", - "hdi_3% | \n", - "hdi_97% | \n", - "mcse_mean | \n", - "mcse_sd | \n", - "ess_bulk | \n", - "ess_tail | \n", - "r_hat | \n", - "
---|---|---|---|---|---|---|---|---|---|
Intercept | \n", - "0.026 | \n", - "0.098 | \n", - "-0.152 | \n", - "0.206 | \n", - "0.003 | \n", - "0.003 | \n", - "796.0 | \n", - "648.0 | \n", - "1.01 | \n", - "
sigma | \n", - "0.945 | \n", - "0.070 | \n", - "0.817 | \n", - "1.074 | \n", - "0.002 | \n", - "0.002 | \n", - "970.0 | \n", - "759.0 | \n", - "1.00 | \n", - "
x | \n", - "0.355 | \n", - "0.103 | \n", - "0.157 | \n", - "0.532 | \n", - "0.003 | \n", - "0.002 | \n", - "1067.0 | \n", - "692.0 | \n", - "1.00 | \n", - "
\n", - " | mean | \n", - "sd | \n", - "hdi_3% | \n", - "hdi_97% | \n", - "mcse_mean | \n", - "mcse_sd | \n", - "ess_bulk | \n", - "ess_tail | \n", - "r_hat | \n", - "
---|---|---|---|---|---|---|---|---|---|
Intercept | \n", - "0.024 | \n", - "0.096 | \n", - "-0.157 | \n", - "0.204 | \n", - "0.001 | \n", - "0.001 | \n", - "7048.0 | \n", - "5524.0 | \n", - "1.0 | \n", - "
sigma | \n", - "0.948 | \n", - "0.068 | \n", - "0.829 | \n", - "1.083 | \n", - "0.001 | \n", - "0.001 | \n", - "7933.0 | \n", - "5659.0 | \n", - "1.0 | \n", - "
x | \n", - "0.361 | \n", - "0.103 | \n", - "0.168 | \n", - "0.550 | \n", - "0.001 | \n", - "0.001 | \n", - "6986.0 | \n", - "5702.0 | \n", - "1.0 | \n", - "
<xarray.Dataset> Size: 40kB\n", + "Dimensions: (chain: 3, draw: 500)\n", + "Coordinates:\n", + " * draw (draw) int64 4kB 0 1 2 3 4 5 6 7 ... 493 494 495 496 497 498 499\n", + " * chain (chain) int64 24B 0 1 2\n", + "Data variables:\n", + " Intercept (chain, draw) float64 12kB 0.08496 -0.02695 ... 0.005357 0.1237\n", + " sigma (chain, draw) float64 12kB 1.116 0.89 0.8934 ... 0.9256 0.926\n", + " x (chain, draw) float64 12kB 0.3081 0.4959 0.3477 ... 0.4546 0.638\n", + "Attributes:\n", + " created_at: 2024-12-21T16:44:15.471804+00:00\n", + " arviz_version: 0.19.0\n", + " modeling_interface: bambi\n", + " modeling_interface_version: 0.14.1.dev17+g25798ce7
<xarray.Dataset> Size: 127kB\n", + "Dimensions: (chain: 3, draw: 500)\n", + "Coordinates:\n", + " * chain (chain) int64 24B 0 1 2\n", + " * draw (draw) int64 4kB 0 1 2 3 4 5 ... 495 496 497 498 499\n", + "Data variables:\n", + " depth (chain, draw) uint64 12kB 2 2 2 2 2 2 ... 2 2 2 2 2 2\n", + " diverging (chain, draw) bool 2kB False False ... False False\n", + " energy (chain, draw) float64 12kB 146.6 147.2 ... 144.6 146.6\n", + " energy_error (chain, draw) float64 12kB 0.5871 -0.6172 ... 0.704\n", + " index_in_trajectory (chain, draw) int64 12kB 2 3 1 -2 -1 ... -2 -1 3 1 -1\n", + " logp (chain, draw) float64 12kB -146.1 -144.8 ... -146.2\n", + " maxdepth_reached (chain, draw) bool 2kB False False ... False False\n", + " mean_tree_accept (chain, draw) float64 12kB 0.9476 0.5462 ... 1.0 1.0\n", + " mean_tree_accept_sym (chain, draw) float64 12kB 0.8644 0.7061 ... 0.8824\n", + " n_steps (chain, draw) uint64 12kB 3 3 3 3 3 3 ... 3 3 3 3 3 3\n", + " step_size (chain, draw) float64 12kB 1.039 1.039 ... 0.9917\n", + " step_size_bar (chain, draw) float64 12kB 1.039 1.039 ... 0.9917\n", + "Attributes:\n", + " created_at: 2024-12-21T16:44:15.348609+00:00\n", + " arviz_version: 0.19.0\n", + " modeling_interface: bambi\n", + " modeling_interface_version: 0.14.1.dev17+g25798ce7
<xarray.Dataset> Size: 2kB\n", + "Dimensions: (__obs__: 100)\n", + "Coordinates:\n", + " * __obs__ (__obs__) int64 800B 0 1 2 3 4 5 6 7 8 ... 92 93 94 95 96 97 98 99\n", + "Data variables:\n", + " y (__obs__) float64 800B 0.9823 -0.1276 1.024 ... -0.4394 0.2223\n", + "Attributes:\n", + " created_at: 2024-12-21T16:44:15.471804+00:00\n", + " arviz_version: 0.19.0\n", + " modeling_interface: bambi\n", + " modeling_interface_version: 0.14.1.dev17+g25798ce7
<xarray.Dataset> Size: 32kB\n", + "Dimensions: (chain: 3, draw: 400)\n", + "Coordinates:\n", + " * chain (chain) int64 24B 0 1 2\n", + " * draw (draw) int64 3kB 0 1 2 3 4 5 6 7 ... 393 394 395 396 397 398 399\n", + "Data variables:\n", + " Intercept (chain, draw) float64 10kB 0.4285 0.4285 ... 0.05143 0.1415\n", + " sigma (chain, draw) float64 10kB 1.157 1.157 0.9778 ... 0.7789 0.8057\n", + " x (chain, draw) float64 10kB -0.1518 -0.1518 ... 0.5574 0.378\n", + "Attributes:\n", + " created_at: 2024-12-21T16:44:15.473126+00:00\n", + " arviz_version: 0.19.0\n", + " modeling_interface: bambi\n", + " modeling_interface_version: 0.14.1.dev17+g25798ce7
<xarray.Dataset> Size: 102kB\n", + "Dimensions: (chain: 3, draw: 400)\n", + "Coordinates:\n", + " * chain (chain) int64 24B 0 1 2\n", + " * draw (draw) int64 3kB 0 1 2 3 4 5 ... 395 396 397 398 399\n", + "Data variables:\n", + " depth (chain, draw) uint64 10kB 2 0 2 1 1 3 ... 2 2 2 2 3 2\n", + " diverging (chain, draw) bool 1kB False True ... False False\n", + " energy (chain, draw) float64 10kB 191.2 163.4 ... 151.0 153.1\n", + " energy_error (chain, draw) float64 10kB -0.388 0.0 ... -0.1098\n", + " index_in_trajectory (chain, draw) int64 10kB -3 0 -1 0 0 3 ... -1 -2 2 4 1\n", + " logp (chain, draw) float64 10kB -161.4 -161.4 ... -149.8\n", + " maxdepth_reached (chain, draw) bool 1kB False False ... False False\n", + " mean_tree_accept (chain, draw) float64 10kB 0.0 0.9011 ... 0.8973\n", + " mean_tree_accept_sym (chain, draw) float64 10kB 0.0 0.8825 ... 0.7341\n", + " n_steps (chain, draw) uint64 10kB 0 3 1 3 3 2 ... 3 3 3 3 3 7\n", + " step_size (chain, draw) float64 10kB 0.4 4.807 ... 0.8206 0.7726\n", + " step_size_bar (chain, draw) float64 10kB 0.4 4.807 ... 0.9982 0.9953\n", + "Attributes:\n", + " created_at: 2024-12-21T16:44:15.351287+00:00\n", + " arviz_version: 0.19.0\n", + " modeling_interface: bambi\n", + " modeling_interface_version: 0.14.1.dev17+g25798ce7
\n", + " | mean | \n", + "sd | \n", + "hdi_3% | \n", + "hdi_97% | \n", + "mcse_mean | \n", + "mcse_sd | \n", + "ess_bulk | \n", + "ess_tail | \n", + "r_hat | \n", + "
---|---|---|---|---|---|---|---|---|---|
Intercept | \n", + "-0.000 | \n", + "0.097 | \n", + "-0.180 | \n", + "0.183 | \n", + "0.003 | \n", + "0.003 | \n", + "938.0 | \n", + "752.0 | \n", + "1.0 | \n", + "
sigma | \n", + "0.987 | \n", + "0.073 | \n", + "0.859 | \n", + "1.126 | \n", + "0.002 | \n", + "0.002 | \n", + "913.0 | \n", + "739.0 | \n", + "1.0 | \n", + "
x | \n", + "0.423 | \n", + "0.125 | \n", + "0.151 | \n", + "0.629 | \n", + "0.004 | \n", + "0.003 | \n", + "1044.0 | \n", + "820.0 | \n", + "1.0 | \n", + "
Intercept | \n", - "0.025 | \n", - "0.095 | \n", - "-0.162 | \n", - "0.196 | \n", + "0.002 | \n", + "0.099 | \n", + "-0.183 | \n", + "0.190 | \n", "0.001 | \n", "0.001 | \n", - "7396.0 | \n", - "5859.0 | \n", + "6775.0 | \n", + "5598.0 | \n", "1.0 | \n", "
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
sigma | \n", - "0.946 | \n", - "0.068 | \n", - "0.819 | \n", - "1.075 | \n", + "0.987 | \n", + "0.071 | \n", + "0.848 | \n", + "1.114 | \n", "0.001 | \n", "0.001 | \n", - "7131.0 | \n", - "5580.0 | \n", + "8338.0 | \n", + "5715.0 | \n", "1.0 | \n", "
x | \n", - "0.361 | \n", - "0.106 | \n", - "0.171 | \n", - "0.569 | \n", + "0.424 | \n", + "0.127 | \n", + "0.186 | \n", + "0.661 | \n", + "0.002 | \n", + "0.001 | \n", + "6244.0 | \n", + "5267.0 | \n", + "1.0 | \n", + "
\n", + " | mean | \n", + "sd | \n", + "hdi_3% | \n", + "hdi_97% | \n", + "mcse_mean | \n", + "mcse_sd | \n", + "ess_bulk | \n", + "ess_tail | \n", + "r_hat | \n", + "||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Intercept | \n", + "0.005 | \n", + "0.098 | \n", + "-0.180 | \n", + "0.188 | \n", + "0.001 | \n", "0.001 | \n", + "9065.0 | \n", + "6523.0 | \n", + "1.0 | \n", + "||||||||
sigma | \n", + "0.988 | \n", + "0.074 | \n", + "0.856 | \n", + "1.127 | \n", + "0.001 | \n", + "0.001 | \n", + "7217.0 | \n", + "5477.0 | \n", + "1.0 | \n", + "||||||||
x | \n", + "0.423 | \n", + "0.130 | \n", + "0.179 | \n", + "0.661 | \n", + "0.002 | \n", "0.001 | \n", - "7673.0 | \n", - "5905.0 | \n", + "7449.0 | \n", + "6203.0 | \n", "1.0 | \n", "||||||
Intercept | \n", - "0.024 | \n", - "0.096 | \n", - "-0.149 | \n", - "0.207 | \n", - "0.003 | \n", + "0.004 | \n", + "0.101 | \n", + "-0.184 | \n", + "0.193 | \n", "0.002 | \n", - "876.0 | \n", - "615.0 | \n", - "1.02 | \n", + "0.001 | \n", + "2352.0 | \n", + "3365.0 | \n", + "1.01 | \n", "
sigma | \n", - "0.947 | \n", - "0.067 | \n", - "0.822 | \n", - "1.066 | \n", + "0.987 | \n", + "0.070 | \n", + "0.861 | \n", + "1.123 | \n", "0.001 | \n", "0.001 | \n", - "5554.0 | \n", - "5920.0 | \n", - "1.00 | \n", + "4252.0 | \n", + "4034.0 | \n", + "1.01 | \n", "|
x | \n", - "0.361 | \n", - "0.104 | \n", - "0.161 | \n", - "0.550 | \n", + "0.425 | \n", + "0.129 | \n", + "0.171 | \n", + "0.656 | \n", "0.001 | \n", "0.001 | \n", - "5081.0 | \n", - "4653.0 | \n", - "1.00 | \n", + "7504.0 | \n", + "3764.0 | \n", + "1.01 | \n", "
\n", + " | mean | \n", + "sd | \n", + "hdi_3% | \n", + "hdi_97% | \n", + "mcse_mean | \n", + "mcse_sd | \n", + "ess_bulk | \n", + "ess_tail | \n", + "r_hat | \n", + "
---|---|---|---|---|---|---|---|---|---|
Intercept | \n", + "0.002 | \n", + "0.098 | \n", + "-0.179 | \n", + "0.181 | \n", + "0.002 | \n", + "0.003 | \n", + "2288.0 | \n", + "1040.0 | \n", + "1.0 | \n", + "
sigma | \n", + "0.989 | \n", + "0.072 | \n", + "0.857 | \n", + "1.118 | \n", + "0.002 | \n", + "0.001 | \n", + "2199.0 | \n", + "1155.0 | \n", + "1.0 | \n", + "
x | \n", + "0.423 | \n", + "0.128 | \n", + "0.176 | \n", + "0.657 | \n", + "0.003 | \n", + "0.002 | \n", + "1956.0 | \n", + "1287.0 | \n", + "1.0 | \n", + "