@@ -163,7 +163,14 @@ def logcdf(self, value):
163
163
-------
164
164
TensorVariable
165
165
"""
166
- # TODO: work with multiple values (see #4342)
166
+ # incomplete_beta function can only handle scalar values (see #4342)
167
+ if np .ndim (value ):
168
+ raise TypeError (
169
+ "Binomial.logcdf expects a scalar value but received a {}-dimensional object." .format (
170
+ np .ndim (value )
171
+ )
172
+ )
173
+
167
174
n = self .n
168
175
p = self .p
169
176
value = tt .floor (value )
@@ -326,7 +333,14 @@ def logcdf(self, value):
326
333
-------
327
334
TensorVariable
328
335
"""
329
- # TODO: fix for multiple values
336
+ # logcdf can only handle scalar values at the moment
337
+ if np .ndim (value ):
338
+ raise TypeError (
339
+ "BetaBinomial.logcdf expects a scalar value but received a {}-dimensional object." .format (
340
+ np .ndim (value )
341
+ )
342
+ )
343
+
330
344
alpha = self .alpha
331
345
beta = self .beta
332
346
n = self .n
@@ -446,11 +460,13 @@ def logcdf(self, value):
446
460
"""
447
461
Compute the log of the cumulative distribution function for Bernoulli distribution
448
462
at the specified value.
463
+
449
464
Parameters
450
465
----------
451
466
value: numeric
452
467
Value(s) for which log CDF is calculated. If the log CDF for multiple
453
468
values are desired the values must be provided in a numpy array or theano tensor.
469
+
454
470
Returns
455
471
-------
456
472
TensorVariable
@@ -583,11 +599,13 @@ def logcdf(self, value):
583
599
"""
584
600
Compute the log of the cumulative distribution function for Discrete Weibull distribution
585
601
at the specified value.
602
+
586
603
Parameters
587
604
----------
588
605
value: numeric
589
606
Value(s) for which log CDF is calculated. If the log CDF for multiple
590
607
values are desired the values must be provided in a numpy array or theano tensor.
608
+
591
609
Returns
592
610
-------
593
611
TensorVariable
@@ -696,11 +714,13 @@ def logcdf(self, value):
696
714
"""
697
715
Compute the log of the cumulative distribution function for Poisson distribution
698
716
at the specified value.
717
+
699
718
Parameters
700
719
----------
701
720
value: numeric
702
721
Value(s) for which log CDF is calculated. If the log CDF for multiple
703
722
values are desired the values must be provided in a numpy array or theano tensor.
723
+
704
724
Returns
705
725
-------
706
726
TensorVariable
@@ -887,7 +907,14 @@ def logcdf(self, value):
887
907
-------
888
908
TensorVariable
889
909
"""
890
- # TODO: work with multiple values (see #4342)
910
+ # incomplete_beta function can only handle scalar values (see #4342)
911
+ if np .ndim (value ):
912
+ raise TypeError (
913
+ "NegativeBinomial.logcdf expects a scalar value but received a {}-dimensional object." .format (
914
+ np .ndim (value )
915
+ )
916
+ )
917
+
891
918
# TODO: avoid `p` recomputation if distribution was defined in terms of `p`
892
919
alpha = self .alpha
893
920
p = alpha / (self .mu + alpha )
@@ -987,11 +1014,13 @@ def logcdf(self, value):
987
1014
"""
988
1015
Compute the log of the cumulative distribution function for Geometric distribution
989
1016
at the specified value.
1017
+
990
1018
Parameters
991
1019
----------
992
1020
value: numeric
993
1021
Value(s) for which log CDF is calculated. If the log CDF for multiple
994
1022
values are desired the values must be provided in a numpy array or theano tensor.
1023
+
995
1024
Returns
996
1025
-------
997
1026
TensorVariable
@@ -1124,15 +1153,24 @@ def logcdf(self, value):
1124
1153
"""
1125
1154
Compute the log of the cumulative distribution function for HyperGeometric distribution
1126
1155
at the specified value.
1156
+
1127
1157
Parameters
1128
1158
----------
1129
1159
value: numeric
1130
1160
Value for which log CDF is calculated.
1161
+
1131
1162
Returns
1132
1163
-------
1133
1164
TensorVariable
1134
1165
"""
1135
- # TODO: fix for multiple values
1166
+ # logcdf can only handle scalar values at the moment
1167
+ if np .ndim (value ):
1168
+ raise TypeError (
1169
+ "BetaBinomial.logcdf expects a scalar value but received a {}-dimensional object." .format (
1170
+ np .ndim (value )
1171
+ )
1172
+ )
1173
+
1136
1174
# TODO: Use lower upper in locgdf for smarter logsumexp?
1137
1175
N = self .N
1138
1176
n = self .n
@@ -1247,11 +1285,13 @@ def logcdf(self, value):
1247
1285
"""
1248
1286
Compute the log of the cumulative distribution function for Discrete uniform distribution
1249
1287
at the specified value.
1288
+
1250
1289
Parameters
1251
1290
----------
1252
1291
value: numeric
1253
1292
Value(s) for which log CDF is calculated. If the log CDF for multiple
1254
1293
values are desired the values must be provided in a numpy array or theano tensor.
1294
+
1255
1295
Returns
1256
1296
-------
1257
1297
TensorVariable
@@ -1558,11 +1598,13 @@ def logcdf(self, value):
1558
1598
"""
1559
1599
Compute the log of the cumulative distribution function for ZeroInflatedPoisson distribution
1560
1600
at the specified value.
1601
+
1561
1602
Parameters
1562
1603
----------
1563
1604
value: numeric
1564
1605
Value(s) for which log CDF is calculated. If the log CDF for multiple
1565
1606
values are desired the values must be provided in a numpy array or theano tensor.
1607
+
1566
1608
Returns
1567
1609
-------
1568
1610
TensorVariable
@@ -1698,7 +1740,14 @@ def logcdf(self, value):
1698
1740
-------
1699
1741
TensorVariable
1700
1742
"""
1701
- # TODO: work with multiple values (see #4342)
1743
+ # logcdf can only handle scalar values due to limitation in Binomial.logcdf
1744
+ if np .ndim (value ):
1745
+ raise TypeError (
1746
+ "ZeroInflatedBinomial.logcdf expects a scalar value but received a {}-dimensional object." .format (
1747
+ np .ndim (value )
1748
+ )
1749
+ )
1750
+
1702
1751
psi = self .psi
1703
1752
1704
1753
return bound (
@@ -1861,7 +1910,13 @@ def logcdf(self, value):
1861
1910
-------
1862
1911
TensorVariable
1863
1912
"""
1864
- # TODO: work with multiple values (see #4342)
1913
+ # logcdf can only handle scalar values due to limitation in NegativeBinomial.logcdf
1914
+ if np .ndim (value ):
1915
+ raise TypeError (
1916
+ "ZeroInflatedNegativeBinomial.logcdf expects a scalar value but received a {}-dimensional object." .format (
1917
+ np .ndim (value )
1918
+ )
1919
+ )
1865
1920
psi = self .psi
1866
1921
1867
1922
return bound (
0 commit comments