Skip to content

Commit 2545d60

Browse files
Merge pull request #3472 from Dpananos/pr_fix
Fix for #3450
2 parents c487b34 + e9b9a44 commit 2545d60

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

pymc3/distributions/multivariate.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@ def _repr_cov_params(self, dist=None):
143143
if dist is None:
144144
dist = self
145145
if self._cov_type == 'chol':
146-
chol = get_variable_name(self.chol)
146+
chol = get_variable_name(self.chol_cov)
147147
return r'\mathit{{chol}}={}'.format(chol)
148148
elif self._cov_type == 'cov':
149149
cov = get_variable_name(self.cov)

pymc3/tests/test_distributions.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1326,17 +1326,21 @@ def setup_class(self):
13261326
b = Normal('beta', mu=0, sigma=10, shape=(2,), observed=beta)
13271327
sigma = HalfNormal('sigma', sigma=1)
13281328

1329+
#Test Cholesky parameterization
1330+
Z = MvNormal('Z', mu=np.zeros(2), chol=np.eye(2), shape=(2,))
1331+
13291332
# Expected value of outcome
13301333
mu = Deterministic('mu', floatX(alpha + tt.dot(X, b)))
13311334

13321335
# Likelihood (sampling distribution) of observations
13331336
Y_obs = Normal('Y_obs', mu=mu, sigma=sigma, observed=Y)
1334-
self.distributions = [alpha, sigma, mu, b, Y_obs]
1337+
self.distributions = [alpha, sigma, mu, b, Z, Y_obs]
13351338
self.expected = (
13361339
r'$\text{alpha} \sim \text{Normal}(\mathit{mu}=0.0,~\mathit{sigma}=10.0)$',
13371340
r'$\text{sigma} \sim \text{HalfNormal}(\mathit{sigma}=1.0)$',
13381341
r'$\text{mu} \sim \text{Deterministic}(\text{alpha},~\text{Constant},~\text{beta})$',
13391342
r'$\text{beta} \sim \text{Normal}(\mathit{mu}=0.0,~\mathit{sigma}=10.0)$',
1343+
r'$Z \sim \text{MvNormal}(\mathit{mu}=array, \mathit{chol}=array)$',
13401344
r'$\text{Y_obs} \sim \text{Normal}(\mathit{mu}=\text{mu},~\mathit{sigma}=f(\text{sigma}))$'
13411345
)
13421346

0 commit comments

Comments
 (0)