|
7 | 7 | from ..model import Model, Point, Potential
|
8 | 8 | from ..blocking import DictToVarBijection, DictToArrayBijection, ArrayOrdering
|
9 | 9 | from ..distributions import (DensityDist, Categorical, Multinomial, VonMises, Dirichlet,
|
10 |
| - MvStudentT, MvNormal, ZeroInflatedPoisson, |
| 10 | + MvStudentT, MvNormal, ZeroInflatedPoisson, GaussianRandomWalk, |
11 | 11 | ZeroInflatedNegativeBinomial, Constant, Poisson, Bernoulli, Beta,
|
12 |
| - BetaBinomial, HalfStudentT, StudentT, Weibull, Pareto, |
| 12 | + BetaBinomial, HalfStudentT, StudentT, Weibull, Pareto, NormalMixture, |
13 | 13 | InverseGamma, Gamma, Cauchy, HalfCauchy, Lognormal, Laplace,
|
14 | 14 | NegativeBinomial, Geometric, Exponential, ExGaussian, Normal,
|
15 | 15 | Flat, LKJCorr, Wald, ChiSquared, HalfNormal, DiscreteUniform,
|
@@ -822,3 +822,17 @@ def ref_pdf(value):
|
822 | 822 | )
|
823 | 823 |
|
824 | 824 | self.pymc3_matches_scipy(TestedInterpolated, R, {}, ref_pdf)
|
| 825 | + |
| 826 | + |
| 827 | +def test_repr_latex_(): |
| 828 | + with Model(): |
| 829 | + x0 = Binomial('Discrete', p=.5, n=10) |
| 830 | + x1 = Normal('Continuous', mu=0., sd=1.) |
| 831 | + x2 = GaussianRandomWalk('Timeseries', mu=x1, sd=1., shape=2) |
| 832 | + x3 = MvStudentT('Multivariate', nu=5, mu=x2, Sigma=np.diag(np.ones(2)), shape=2) |
| 833 | + x4 = NormalMixture('Mixture', w=np.array([.5, .5]), mu=x3, sd=x0) |
| 834 | + assert x0._repr_latex_()=='$Discrete \\sim \\text{Binomial}(\\mathit{n}=10, \\mathit{p}=0.5)$' |
| 835 | + assert x1._repr_latex_()=='$Continuous \\sim \\text{Normal}(\\mathit{mu}=0.0, \\mathit{sd}=1.0)$' |
| 836 | + assert x2._repr_latex_()=='$Timeseries \\sim \\text{GaussianRandomWalk}(\\mathit{mu}=Continuous, \\mathit{sd}=1.0)$' |
| 837 | + assert x3._repr_latex_()=='$Multivariate \\sim \\text{MvStudentT}(\\mathit{nu}=5, \\mathit{mu}=Timeseries, \\mathit{Sigma}=array)$' |
| 838 | + assert x4._repr_latex_()=='$Mixture \\sim \\text{NormalMixture}(\\mathit{w}=array, \\mathit{mu}=Multivariate, \\mathit{sigma}=f(Discrete))$' |
0 commit comments