Skip to content

Commit f3ac08b

Browse files
vitalisetpibieta
andauthored
Updating docstrings of distributions (#5998)
* updating docstrings of distributions * updating dimentions following matplotlibs convention. also adding pablo as a contributor. Co-authored-by: pibieta <[email protected]> * resolving @OriolAbril review with @pibieta Co-authored-by: pibieta <[email protected]>
1 parent c93711a commit f3ac08b

File tree

2 files changed

+37
-37
lines changed

2 files changed

+37
-37
lines changed

docs/source/conf.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@
6464
# fmt: off
6565
numpydoc_xref_ignore = {
6666
"of", "or", "optional", "default", "numeric", "type", "scalar", "1D", "2D", "3D", "nD", "array",
67-
"instance"
67+
"instance", "M", "N"
6868
}
6969
# fmt: on
7070
numpydoc_xref_aliases = {

pymc/distributions/multivariate.py

Lines changed: 36 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -918,7 +918,7 @@ class Wishart(Continuous):
918918
----------
919919
nu : tensor_like of int
920920
Degrees of freedom, > 0.
921-
V : array_like
921+
V : tensor_like of float
922922
p x p positive definite matrix.
923923
924924
Notes
@@ -1262,41 +1262,41 @@ class LKJCholeskyCov:
12621262
12631263
Parameters
12641264
----------
1265-
name: str
1265+
name : str
12661266
The name given to the variable in the model.
1267-
eta: float
1267+
eta : tensor_like of float
12681268
The shape parameter (eta > 0) of the LKJ distribution. eta = 1
12691269
implies a uniform distribution of the correlation matrices;
12701270
larger values put more weight on matrices with few correlations.
1271-
n: int
1271+
n : tensor_like of int
12721272
Dimension of the covariance matrix (n > 1).
1273-
sd_dist: unnamed distribution
1273+
sd_dist : Distribution
12741274
A positive scalar or vector distribution for the standard deviations, created
12751275
with the `.dist()` API. Should have `shape[-1]=n`. Scalar distributions will be
12761276
automatically resized to ensure this.
12771277
12781278
.. warning:: sd_dist will be cloned, rendering it independent of the one passed as input.
12791279
1280-
compute_corr: bool, default=True
1280+
compute_corr : bool, default=True
12811281
If `True`, returns three values: the Cholesky decomposition, the correlations
12821282
and the standard deviations of the covariance matrix. Otherwise, only returns
12831283
the packed Cholesky decomposition. Defaults to `True`.
12841284
compatibility.
1285-
store_in_trace: bool, default=True
1285+
store_in_trace : bool, default=True
12861286
Whether to store the correlations and standard deviations of the covariance
12871287
matrix in the posterior trace. If `True`, they will automatically be named as
12881288
`{name}_corr` and `{name}_stds` respectively. Effective only when
12891289
`compute_corr=True`.
12901290
12911291
Returns
12921292
-------
1293-
chol: TensorVariable
1293+
chol : TensorVariable
12941294
If `compute_corr=True`. The unpacked Cholesky covariance decomposition.
1295-
corr: TensorVariable
1295+
corr : TensorVariable
12961296
If `compute_corr=True`. The correlations of the covariance matrix.
1297-
stds: TensorVariable
1297+
stds : TensorVariable
12981298
If `compute_corr=True`. The standard deviations of the covariance matrix.
1299-
packed_chol: TensorVariable
1299+
packed_chol : TensorVariable
13001300
If `compute_corr=False` The packed Cholesky covariance decomposition.
13011301
13021302
Notes
@@ -1507,9 +1507,9 @@ class LKJCorr(BoundedContinuous):
15071507
15081508
Parameters
15091509
----------
1510-
n: int
1510+
n : tensor_like of int
15111511
Dimension of the covariance matrix (n > 1).
1512-
eta: float
1512+
eta : tensor_like of float
15131513
The shape parameter (eta > 0) of the LKJ distribution. eta = 1
15141514
implies a uniform distribution of the correlation matrices;
15151515
larger values put more weight on matrices with few correlations.
@@ -1649,20 +1649,20 @@ class MatrixNormal(Continuous):
16491649
16501650
Parameters
16511651
----------
1652-
mu: array
1652+
mu : tensor_like of float
16531653
Array of means. Must be broadcastable with the random variable X such
1654-
that the shape of mu + X is (m,n).
1655-
rowcov: mxm array
1654+
that the shape of mu + X is (M, N).
1655+
rowcov : (M, M) tensor_like of float, optional
16561656
Among-row covariance matrix. Defines variance within
16571657
columns. Exactly one of rowcov or rowchol is needed.
1658-
rowchol: mxm array
1658+
rowchol : (M, M) tensor_like of float, optional
16591659
Cholesky decomposition of among-row covariance matrix. Exactly one of
16601660
rowcov or rowchol is needed.
1661-
colcov: nxn array
1661+
colcov : (N, N) tensor_like of float, optional
16621662
Among-column covariance matrix. If rowcov is the identity matrix,
16631663
this functions as `cov` in MvNormal.
16641664
Exactly one of colcov or colchol is needed.
1665-
colchol: nxn array
1665+
colchol : (N, N) tensor_like of float, optional
16661666
Cholesky decomposition of among-column covariance matrix. Exactly one
16671667
of colcov or colchol is needed.
16681668
@@ -1850,27 +1850,26 @@ class KroneckerNormal(Continuous):
18501850
======== ==========================
18511851
Support :math:`x \in \mathbb{R}^N`
18521852
Mean :math:`\mu`
1853-
Variance :math:`K = \bigotimes K_i` + \sigma^2 I_N
1853+
Variance :math:`K = \bigotimes K_i + \sigma^2 I_N`
18541854
======== ==========================
18551855
18561856
Parameters
18571857
----------
1858-
mu: array
1858+
mu : tensor_like of float
18591859
Vector of means, just as in `MvNormal`.
1860-
covs: list of arrays
1860+
covs : list of arrays
18611861
The set of covariance matrices :math:`[K_1, K_2, ...]` to be
18621862
Kroneckered in the order provided :math:`\bigotimes K_i`.
1863-
chols: list of arrays
1863+
chols : list of arrays
18641864
The set of lower cholesky matrices :math:`[L_1, L_2, ...]` such that
18651865
:math:`K_i = L_i L_i'`.
1866-
evds: list of tuples
1866+
evds : list of tuples
18671867
The set of eigenvalue-vector, eigenvector-matrix pairs
18681868
:math:`[(v_1, Q_1), (v_2, Q_2), ...]` such that
18691869
:math:`K_i = Q_i \text{diag}(v_i) Q_i'`. For example::
18701870
18711871
v_i, Q_i = at.nlinalg.eigh(K_i)
1872-
1873-
sigma: scalar, variable
1872+
sigma : scalar, optional
18741873
Standard deviation of the Gaussian white noise.
18751874
18761875
Examples
@@ -2102,19 +2101,20 @@ class CAR(Continuous):
21022101
21032102
Parameters
21042103
----------
2105-
mu: array
2104+
mu : tensor_like of float
21062105
Real-valued mean vector
2107-
W: Numpy matrix
2106+
W : (M, M) tensor_like of int
21082107
Symmetric adjacency matrix of 1s and 0s indicating
2109-
adjacency between elements.
2110-
alpha: float or array
2108+
adjacency between elements. If possible, *W* is converted
2109+
to a sparse matrix, falling back to a dense variable.
2110+
:func:`~aesara.sparse.basic.as_sparse_or_tensor_variable` is
2111+
used for this sparse or tensorvariable conversion.
2112+
alpha : tensor_like of float
21112113
Autoregression parameter taking values between -1 and 1. Values closer to 0 indicate weaker
21122114
correlation and values closer to 1 indicate higher autocorrelation. For most use cases, the
2113-
support of alpha should be restricted to (0, 1)
2114-
tau: float or array
2115+
support of alpha should be restricted to (0, 1).
2116+
tau : tensor_like of float
21152117
Positive precision variable controlling the scale of the underlying normal variates.
2116-
sparse: bool, default=False
2117-
Determines whether or not sparse computations are used
21182118
21192119
References
21202120
----------
@@ -2267,9 +2267,9 @@ class StickBreakingWeights(SimplexContinuous):
22672267
22682268
Parameters
22692269
----------
2270-
alpha: float
2270+
alpha : tensor_like of float
22712271
Concentration parameter (alpha > 0).
2272-
K: int
2272+
K : tensor_like of int
22732273
The number of "sticks" to break off from an initial one-unit stick. The length of the weight
22742274
vector is K + 1, where the last weight is one minus the sum of all the first sticks.
22752275

0 commit comments

Comments
 (0)