Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions pymc/distributions/multivariate.py
Original file line number Diff line number Diff line change
Expand Up @@ -233,6 +233,8 @@ class MvNormal(Continuous):
def dist(cls, mu, cov=None, tau=None, chol=None, lower=True, **kwargs):
mu = at.as_tensor_variable(mu)
cov = quaddist_matrix(cov, chol, tau, lower)
# Aesara is stricter about the shape of mu, than PyMC used to be
mu = at.broadcast_arrays(mu, cov[..., -1])[0]
return super().dist([mu, cov], **kwargs)

def get_moment(rv, size, mu, cov):
Expand Down Expand Up @@ -362,6 +364,8 @@ def dist(cls, nu, Sigma=None, mu=None, cov=None, tau=None, chol=None, lower=True
nu = at.as_tensor_variable(floatX(nu))
mu = at.as_tensor_variable(floatX(mu))
cov = quaddist_matrix(cov, chol, tau, lower)
# Aesara is stricter about the shape of mu, than PyMC used to be
mu = at.broadcast_arrays(mu, cov[..., -1])[0]
assert_negative_support(nu, "nu", "MvStudentT")
return super().dist([nu, mu, cov], **kwargs)

Expand Down
4 changes: 2 additions & 2 deletions pymc/tests/test_distributions.py
Original file line number Diff line number Diff line change
Expand Up @@ -2903,7 +2903,7 @@ def setup_class(self):
r"sigma ~ N**+(0, 1)",
r"mu ~ Deterministic(f(beta, alpha))",
r"beta ~ N(0, 10)",
r"Z ~ N(<constant>, f())",
r"Z ~ N(f(), f())",
r"nb_with_p_n ~ NB(10, nbp)",
r"Y_obs ~ N(mu, sigma)",
r"pot ~ Potential(f(beta, alpha))",
Expand All @@ -2923,7 +2923,7 @@ def setup_class(self):
r"$\text{sigma} \sim \operatorname{N^{+}}(0,~1)$",
r"$\text{mu} \sim \operatorname{Deterministic}(f(\text{beta},~\text{alpha}))$",
r"$\text{beta} \sim \operatorname{N}(0,~10)$",
r"$\text{Z} \sim \operatorname{N}(\text{<constant>},~f())$",
r"$\text{Z} \sim \operatorname{N}(f(),~f())$",
r"$\text{nb_with_p_n} \sim \operatorname{NB}(10,~\text{nbp})$",
r"$\text{Y_obs} \sim \operatorname{N}(\text{mu},~\text{sigma})$",
r"$\text{pot} \sim \operatorname{Potential}(f(\text{beta},~\text{alpha}))$",
Expand Down
2 changes: 1 addition & 1 deletion pymc/tests/test_distributions_moments.py
Original file line number Diff line number Diff line change
Expand Up @@ -929,7 +929,7 @@ def test_mv_normal_moment(mu, cov, size, expected):
with Model() as model:
x = MvNormal("x", mu=mu, cov=cov, size=size)

# MvNormal logp is only impemented for up to 2D variables
# MvNormal logp is only implemented for up to 2D variables
assert_moment_is_expected(model, expected, check_finite_logp=x.ndim < 3)


Expand Down
Loading