|
34 | 34 | ":::\n", |
35 | 35 | "\n", |
36 | 36 | "**Related API reference:** \n", |
37 | | - "- [Dims — distributions](https://www.pymc.io/projects/docs/en/stable/api/dims/distributions.html) \n", |
38 | | - "- [Dims — transforms](https://www.pymc.io/projects/docs/en/stable/api/dims/transforms.html) \n", |
39 | | - "- [Dims — math](https://www.pymc.io/projects/docs/en/stable/api/dims/math.html)\n", |
| 37 | + "- {doc}`Dims — distributions </api/dims/distributions>`\n", |
| 38 | + "- {doc}`Dims — transforms </api/dims/transforms>`\n", |
| 39 | + "- {doc}`Dims — math </api/dims/math>`\n", |
40 | 40 | "\n", |
41 | 41 | "## A simple example\n", |
42 | 42 | "\n", |
|
315 | 315 | "\n", |
316 | 316 | "There are some notable differences:\n", |
317 | 317 | "\n", |
318 | | - "1. [`ZeroSumNormal`](https://www.pymc.io/projects/docs/en/stable/api/dims/distributions.html#pymc.distributions.ZeroSumNormal) takes a `core_dims` argument instead of `n_zerosum_axes`. This tells PyMC which of the `dims` that define the distribution are constrained to be zero-summed. All distributions that take non-scalar parameters now require a `core_dims` argument. Previously, they were assumed to be right-aligned by the user (see {doc}`dimensionality`). Now you don't have to worry about the order of dimensions in your model, only their meaning.\n", |
| 318 | + "1. {class}`~pymc.distributions.ZeroSumNormal` takes a `core_dims` argument instead of `n_zerosum_axes`. This tells PyMC which of the `dims` that define the distribution are constrained to be zero-summed. All distributions that take non-scalar parameters now require a `core_dims` argument. Previously, they were assumed to be right-aligned by the user (see {doc}`dimensionality`). Now you don't have to worry about the order of dimensions in your model, only their meaning.\n", |
319 | 319 | "\n", |
320 | 320 | "2. The `trial_preference` computation aligns dimensions for broadcasting automatically. Note we use {func}`pymc.dims.Deterministic` (not {func}`pymc.Deterministic`), which automatically propagates the `dims` to the model object.\n", |
321 | 321 | "\n", |
322 | 322 | "3. The `softmax` operation specifies the `dim` argument, not the positional axis. *Note:* The parameter is called `dim` and not `core_dims` because we try to stay as close as possible to the Xarray API (which uses `dim` throughout). We make an exception for distributions because they already have the `dims` argument.\n", |
323 | 323 | "\n", |
324 | | - "4. [`Categorical`](https://www.pymc.io/projects/docs/en/stable/api/dims/distributions.html#pymc.distributions.Categorical) observed variables, like `ZeroSumNormal`, require a `core_dims` argument to specify which dimension corresponds to the probability vector. Previously, it was necessary to place this dimension explicitly on the rightmost axis — not anymore!\n", |
| 324 | + "4. {class}`~pymc.distributions.Categorical` observed variables, like `ZeroSumNormal`, require a `core_dims` argument to specify which dimension corresponds to the probability vector. Previously, it was necessary to place this dimension explicitly on the rightmost axis — not anymore!\n", |
325 | 325 | "\n", |
326 | 326 | "5. Even when `dims` are not specified for either `trial_preference` or `response`, PyMC automatically infers them.\n", |
327 | 327 | "\n", |
|
891 | 891 | "\n", |
892 | 892 | " * All vector arguments (and observed values) must have known dims. An error is raised otherwise.\n", |
893 | 893 | "\n", |
894 | | - " * Distributions with non-scalar inputs will require a `core_dims` argument. The meaning of the `core_dims` argument will be denoted in the docstrings of each distribution. For example, for the [`MvNormal`](https://www.pymc.io/projects/docs/en/stable/api/dims/generated/pymc.dims.MvNormal.html#pymc.dims.MvNormal), the `core_dims` are the two dimensions of the covariance matrix, one (and only one) of which must also be present in the mean parameter. The shared `core_dim` is the one that persists in the output. Sometimes the order of `core_dims` will be important!\n", |
| 894 | + " * Distributions with non-scalar inputs will require a `core_dims` argument. The meaning of the `core_dims` argument will be denoted in the docstrings of each distribution. For example, for the {class}`~pymc.distributions.MvNormal`, the `core_dims` are the two dimensions of the covariance matrix, one (and only one) of which must also be present in the mean parameter. The shared `core_dim` is the one that persists in the output. Sometimes the order of `core_dims` will be important!\n", |
895 | 895 | "\n", |
896 | 896 | " * `dims` accept ellipsis, and variables are transposed to match the user-specified `dims` argument.\n", |
897 | 897 | "\n", |
|
0 commit comments