Skip to content

Commit c2edfb1

Browse files
Rojan ShresthaRojan Shrestha
authored andcommitted
after adding codeblocks,imports
1 parent 7e47f7a commit c2edfb1

File tree

1 file changed

+15
-8
lines changed

1 file changed

+15
-8
lines changed

pymc/distributions/multivariate.py

Lines changed: 15 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1791,14 +1791,21 @@ class MatrixNormal(Continuous):
17911791
Examples
17921792
--------
17931793
Define a matrixvariate normal variable for given row and column covariance
1794-
matrices::
1795-
with pm.Model() as model:
1796-
colcov = np.array([[1.0, 0.5], [0.5, 2]])
1797-
rowcov = np.array([[1, 0, 0], [0, 4, 0], [0, 0, 16]])
1798-
m = rowcov.shape[0]
1799-
n = colcov.shape[0]
1800-
mu = np.zeros((m, n))
1801-
vals = pm.MatrixNormal("vals", mu=mu, colcov=colcov, rowcov=rowcov)
1794+
matrices.
1795+
1796+
.. code:: python
1797+
1798+
import pymc as pm
1799+
import numpy as np
1800+
import pytensor.tensor as pt
1801+
1802+
with pm.Model() as model:
1803+
colcov = np.array([[1.0, 0.5], [0.5, 2]])
1804+
rowcov = np.array([[1, 0, 0], [0, 4, 0], [0, 0, 16]])
1805+
m = rowcov.shape[0]
1806+
n = colcov.shape[0]
1807+
mu = np.zeros((m, n))
1808+
vals = pm.MatrixNormal("vals", mu=mu, colcov=colcov, rowcov=rowcov)
18021809
18031810
Above, the ith row in vals has a variance that is scaled by 4^i.
18041811
Alternatively, row or column cholesky matrices could be substituted for

0 commit comments

Comments
 (0)