99 NegativeBinomial ,
1010 Normal ,
1111 Uniform ,
12+ ZeroInflatedPoisson ,
1213)
1314from pymc .math import dot
1415from pymc .model import Deterministic , Model , Potential
@@ -47,6 +48,9 @@ def setup_class(self):
4748 # )
4849 nb2 = NegativeBinomial ("nb_with_p_n" , p = Uniform ("nbp" ), n = 10 )
4950
51+ # Symbolic distribution
52+ zip = ZeroInflatedPoisson ("zip" , 0.5 , 5 )
53+
5054 # Expected value of outcome
5155 mu = Deterministic ("mu" , floatX (alpha + dot (X , b )))
5256
@@ -76,7 +80,7 @@ def setup_class(self):
7680 # add a potential as well
7781 pot = Potential ("pot" , mu ** 2 )
7882
79- self .distributions = [alpha , sigma , mu , b , Z , nb2 , Y_obs , pot ]
83+ self .distributions = [alpha , sigma , mu , b , Z , nb2 , zip , Y_obs , pot ]
8084 self .deterministics_or_potentials = [mu , pot ]
8185 # tuples of (formatting, include_params
8286 self .formats = [("plain" , True ), ("plain" , False ), ("latex" , True ), ("latex" , False )]
@@ -88,6 +92,7 @@ def setup_class(self):
8892 r"beta ~ N(0, 10)" ,
8993 r"Z ~ N(f(), f())" ,
9094 r"nb_with_p_n ~ NB(10, nbp)" ,
95+ r"zip ~ MarginalMixtureRV{inline=False}" ,
9196 r"Y_obs ~ N(mu, sigma)" ,
9297 r"pot ~ Potential(f(beta, alpha))" ,
9398 ],
@@ -98,6 +103,7 @@ def setup_class(self):
98103 r"beta ~ N" ,
99104 r"Z ~ N" ,
100105 r"nb_with_p_n ~ NB" ,
106+ r"zip ~ MarginalMixtureRV{inline=False}" ,
101107 r"Y_obs ~ N" ,
102108 r"pot ~ Potential" ,
103109 ],
@@ -108,6 +114,7 @@ def setup_class(self):
108114 r"$\text{beta} \sim \operatorname{N}(0,~10)$" ,
109115 r"$\text{Z} \sim \operatorname{N}(f(),~f())$" ,
110116 r"$\text{nb_with_p_n} \sim \operatorname{NB}(10,~\text{nbp})$" ,
117+ r"$\text{zip} \sim \text{MarginalMixtureRV{inline=False}}$" ,
111118 r"$\text{Y_obs} \sim \operatorname{N}(\text{mu},~\text{sigma})$" ,
112119 r"$\text{pot} \sim \operatorname{Potential}(f(\text{beta},~\text{alpha}))$" ,
113120 ],
@@ -118,6 +125,7 @@ def setup_class(self):
118125 r"$\text{beta} \sim \operatorname{N}$" ,
119126 r"$\text{Z} \sim \operatorname{N}$" ,
120127 r"$\text{nb_with_p_n} \sim \operatorname{NB}$" ,
128+ r"$\text{zip} \sim \text{MarginalMixtureRV{inline=False}}$" ,
121129 r"$\text{Y_obs} \sim \operatorname{N}$" ,
122130 r"$\text{pot} \sim \operatorname{Potential}$" ,
123131 ],
0 commit comments