@@ -88,6 +88,32 @@ def random(self, point=None, size=None):
88
88
size = size )
89
89
90
90
def logp (self , value ):
91
+ """
92
+ Calculate log-probability of Binomial distribution at specified value.
93
+
94
+ Parameters
95
+ ----------
96
+ value : numeric
97
+ Value(s) for which log-probability is calculated. If the log probabilities for multiple
98
+ values are desired the values must be provided in a numpy array or theano tensor
99
+
100
+ Returns
101
+ -------
102
+ TensorVariable
103
+ """
104
+ """
105
+ Calculate log-probability of Binomial distribution at specified value.
106
+
107
+ Parameters
108
+ ----------
109
+ value : numeric
110
+ Value(s) for which log-probability is calculated. If the log probabilities for multiple
111
+ values are desired the values must be provided in a numpy array or theano tensor
112
+
113
+ Returns
114
+ -------
115
+ TensorVariable
116
+ """
91
117
n = self .n
92
118
p = self .p
93
119
@@ -211,6 +237,19 @@ def random(self, point=None, size=None):
211
237
size = size )
212
238
213
239
def logp (self , value ):
240
+ """
241
+ Calculate log-probability of BetaBinomial distribution at specified value.
242
+
243
+ Parameters
244
+ ----------
245
+ value : numeric
246
+ Value(s) for which log-probability is calculated. If the log probabilities for multiple
247
+ values are desired the values must be provided in a numpy array or theano tensor
248
+
249
+ Returns
250
+ -------
251
+ TensorVariable
252
+ """
214
253
alpha = self .alpha
215
254
beta = self .beta
216
255
return bound (binomln (self .n , value )
@@ -308,6 +347,19 @@ def random(self, point=None, size=None):
308
347
size = size )
309
348
310
349
def logp (self , value ):
350
+ """
351
+ Calculate log-probability of Bernoulli distribution at specified value.
352
+
353
+ Parameters
354
+ ----------
355
+ value : numeric
356
+ Value(s) for which log-probability is calculated. If the log probabilities for multiple
357
+ values are desired the values must be provided in a numpy array or theano tensor
358
+
359
+ Returns
360
+ -------
361
+ TensorVariable
362
+ """
311
363
if self ._is_logit :
312
364
lp = tt .switch (value , self ._logit_p , - self ._logit_p )
313
365
return - log1pexp (- lp )
@@ -374,6 +426,19 @@ def __init__(self, q, beta, *args, **kwargs):
374
426
self .median = self ._ppf (0.5 )
375
427
376
428
def logp (self , value ):
429
+ """
430
+ Calculate log-probability of DiscreteWeibull distribution at specified value.
431
+
432
+ Parameters
433
+ ----------
434
+ value : numeric
435
+ Value(s) for which log-probability is calculated. If the log probabilities for multiple
436
+ values are desired the values must be provided in a numpy array or theano tensor
437
+
438
+ Returns
439
+ -------
440
+ TensorVariable
441
+ """
377
442
q = self .q
378
443
beta = self .beta
379
444
@@ -503,6 +568,19 @@ def random(self, point=None, size=None):
503
568
size = size )
504
569
505
570
def logp (self , value ):
571
+ """
572
+ Calculate log-probability of Poisson distribution at specified value.
573
+
574
+ Parameters
575
+ ----------
576
+ value : numeric
577
+ Value(s) for which log-probability is calculated. If the log probabilities for multiple
578
+ values are desired the values must be provided in a numpy array or theano tensor
579
+
580
+ Returns
581
+ -------
582
+ TensorVariable
583
+ """
506
584
mu = self .mu
507
585
log_prob = bound (
508
586
logpow (mu , value ) - factln (value ) - mu ,
@@ -601,6 +679,19 @@ def random(self, point=None, size=None):
601
679
return np .asarray (stats .poisson .rvs (g )).reshape (g .shape )
602
680
603
681
def logp (self , value ):
682
+ """
683
+ Calculate log-probability of NegativeBinomial distribution at specified value.
684
+
685
+ Parameters
686
+ ----------
687
+ value : numeric
688
+ Value(s) for which log-probability is calculated. If the log probabilities for multiple
689
+ values are desired the values must be provided in a numpy array or theano tensor
690
+
691
+ Returns
692
+ -------
693
+ TensorVariable
694
+ """
604
695
mu = self .mu
605
696
alpha = self .alpha
606
697
negbinom = bound (binomln (value + alpha - 1 , value )
@@ -689,6 +780,19 @@ def random(self, point=None, size=None):
689
780
size = size )
690
781
691
782
def logp (self , value ):
783
+ """
784
+ Calculate log-probability of Geometric distribution at specified value.
785
+
786
+ Parameters
787
+ ----------
788
+ value : numeric
789
+ Value(s) for which log-probability is calculated. If the log probabilities for multiple
790
+ values are desired the values must be provided in a numpy array or theano tensor
791
+
792
+ Returns
793
+ -------
794
+ TensorVariable
795
+ """
692
796
p = self .p
693
797
return bound (tt .log (p ) + logpow (1 - p , value - 1 ),
694
798
0 <= p , p <= 1 , value >= 1 )
@@ -778,6 +882,19 @@ def random(self, point=None, size=None):
778
882
size = size )
779
883
780
884
def logp (self , value ):
885
+ """
886
+ Calculate log-probability of DiscreteUniform distribution at specified value.
887
+
888
+ Parameters
889
+ ----------
890
+ value : numeric
891
+ Value(s) for which log-probability is calculated. If the log probabilities for multiple
892
+ values are desired the values must be provided in a numpy array or theano tensor
893
+
894
+ Returns
895
+ -------
896
+ TensorVariable
897
+ """
781
898
upper = self .upper
782
899
lower = self .lower
783
900
return bound (- tt .log (upper - lower + 1 ),
@@ -871,6 +988,19 @@ def random(self, point=None, size=None):
871
988
size = size )
872
989
873
990
def logp (self , value ):
991
+ """
992
+ Calculate log-probability of Categorical distribution at specified value.
993
+
994
+ Parameters
995
+ ----------
996
+ value : numeric
997
+ Value(s) for which log-probability is calculated. If the log probabilities for multiple
998
+ values are desired the values must be provided in a numpy array or theano tensor
999
+
1000
+ Returns
1001
+ -------
1002
+ TensorVariable
1003
+ """
874
1004
p_ = self .p
875
1005
k = self .k
876
1006
@@ -940,6 +1070,19 @@ def _random(c, dtype=dtype, size=None):
940
1070
size = size ).astype (dtype )
941
1071
942
1072
def logp (self , value ):
1073
+ """
1074
+ Calculate log-probability of Constant distribution at specified value.
1075
+
1076
+ Parameters
1077
+ ----------
1078
+ value : numeric
1079
+ Value(s) for which log-probability is calculated. If the log probabilities for multiple
1080
+ values are desired the values must be provided in a numpy array or theano tensor
1081
+
1082
+ Returns
1083
+ -------
1084
+ TensorVariable
1085
+ """
943
1086
c = self .c
944
1087
return bound (0 , tt .eq (value , c ))
945
1088
@@ -1035,6 +1178,19 @@ def random(self, point=None, size=None):
1035
1178
return g * (np .random .random (g .shape ) < psi )
1036
1179
1037
1180
def logp (self , value ):
1181
+ """
1182
+ Calculate log-probability of ZeroInflatedPoisson distribution at specified value.
1183
+
1184
+ Parameters
1185
+ ----------
1186
+ value : numeric
1187
+ Value(s) for which log-probability is calculated. If the log probabilities for multiple
1188
+ values are desired the values must be provided in a numpy array or theano tensor
1189
+
1190
+ Returns
1191
+ -------
1192
+ TensorVariable
1193
+ """
1038
1194
psi = self .psi
1039
1195
theta = self .theta
1040
1196
@@ -1144,6 +1300,19 @@ def random(self, point=None, size=None):
1144
1300
return g * (np .random .random (g .shape ) < psi )
1145
1301
1146
1302
def logp (self , value ):
1303
+ """
1304
+ Calculate log-probability of ZeroInflatedBinomial distribution at specified value.
1305
+
1306
+ Parameters
1307
+ ----------
1308
+ value : numeric
1309
+ Value(s) for which log-probability is calculated. If the log probabilities for multiple
1310
+ values are desired the values must be provided in a numpy array or theano tensor
1311
+
1312
+ Returns
1313
+ -------
1314
+ TensorVariable
1315
+ """
1147
1316
psi = self .psi
1148
1317
p = self .p
1149
1318
n = self .n
@@ -1279,6 +1448,19 @@ def random(self, point=None, size=None):
1279
1448
return stats .poisson .rvs (g ) * (np .random .random (g .shape ) < psi )
1280
1449
1281
1450
def logp (self , value ):
1451
+ """
1452
+ Calculate log-probability of ZeroInflatedNegativeBinomial distribution at specified value.
1453
+
1454
+ Parameters
1455
+ ----------
1456
+ value : numeric
1457
+ Value(s) for which log-probability is calculated. If the log probabilities for multiple
1458
+ values are desired the values must be provided in a numpy array or theano tensor
1459
+
1460
+ Returns
1461
+ -------
1462
+ TensorVariable
1463
+ """
1282
1464
alpha = self .alpha
1283
1465
mu = self .mu
1284
1466
psi = self .psi
0 commit comments