Skip to content

Commit fdfedd7

Browse files
committed
Add note about the effects of dims and observed on the shape of a variable
1 parent ff172bd commit fdfedd7

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

pymc/distributions/distribution.py

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -209,14 +209,17 @@ def __new__(
209209
rng : optional
210210
Random number generator to use with the RandomVariable.
211211
dims : tuple, optional
212-
A tuple of dimension names known to the model.
212+
A tuple of dimension names known to the model. When shape is not provided,
213+
the shape of dims is used to define the shape of the variable.
213214
initval : optional
214215
Numeric or symbolic untransformed initial value of matching shape,
215216
or one of the following initial value strategies: "moment", "prior".
216217
Depending on the sampler's settings, a random jitter may be added to numeric, symbolic
217218
or moment-based initial values in the transformed space.
218219
observed : optional
219220
Observed data to be passed when registering the random variable in the model.
221+
When neither shape nor dims is provided, the shape of observed is used to
222+
define the shape of the variable.
220223
See ``Model.register_rv``.
221224
total_size : float, optional
222225
See ``Model.register_rv``.
@@ -405,14 +408,17 @@ def __new__(
405408
name : str
406409
Name for the new model variable.
407410
dims : tuple, optional
408-
A tuple of dimension names known to the model.
411+
A tuple of dimension names known to the model. When shape is not provided,
412+
the shape of dims is used to define the shape of the variable.
409413
initval : optional
410414
Numeric or symbolic untransformed initial value of matching shape,
411415
or one of the following initial value strategies: "moment", "prior".
412416
Depending on the sampler's settings, a random jitter may be added to numeric,
413417
symbolic or moment-based initial values in the transformed space.
414418
observed : optional
415419
Observed data to be passed when registering the random variable in the model.
420+
When neither shape nor dims is provided, the shape of observed is used to
421+
define the shape of the variable.
416422
See ``Model.register_rv``.
417423
total_size : float, optional
418424
See ``Model.register_rv``.

0 commit comments

Comments
 (0)