pymc-devs/pymc

Increase support for batched multivariate distributions

Open

#5,383 创建于 2022年1月24日

在 GitHub 查看
 (9 评论) (0 反应) (0 负责人)Python (1,902 fork)batch import
enhancementshelp wanted

仓库指标

Star
 (7,926 star)
PR 合并指标
 (平均合并 11天) (30 天内合并 7 个 PR)

描述

The logp of several multivariate distributions does not work (or is not tested) for arbitrarily batched dimensions. Some cases I could confirm include:

  • MvNormal - #6897
  • MvStudentT #6897
  • KroneckerNormal
  • MatrixNormal
  • LKJCorr
  • LKJCholeskyCov
  • StickBreakingWeights (alpha) #6042
  • Wishart (may be fine to ignore) #8246
  • CARRV (maybe better to leave this one as is)

Reproducible code:

size = (4, 3)
pm.logp(pm.MvNormal.dist(mu=np.ones(2), cov=np.eye(2), size=size), np.ones((*size, 2)))
# ValueError: Invalid dimension for value: 3
pm.logp(pm.MvStudentT.dist(nu=3, mu=np.ones(2), cov=np.eye(2), size=size), np.ones((*size, 2)))
# ValueError: Invalid dimension for value: 3

Distributions that already support (and have tests for) arbitrary shapes

贡献者指南