Skip to content

Commit 9e4c7f9

Browse files
authored
regularize binomial bart (#4720)
* regularize binomial bart * update release notes
1 parent 8cb87fe commit 9e4c7f9

File tree

2 files changed

+10
-8
lines changed

2 files changed

+10
-8
lines changed

Diff for: RELEASE-NOTES.md

+2-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,8 @@
77
+ Fix bug in the computation of the log pseudolikelihood values (SMC-ABC). (see [#4672](https://github.com/pymc-devs/pymc3/pull/4672)).
88

99
### New Features
10-
+ BART with non-gaussian likelihoods (see [#4675](https://github.com/pymc-devs/pymc3/pull/4675) and [#4709](https://github.com/pymc-devs/pymc3/pull/4709)).
10+
+ Generalized BART, bounded distributions like Binomial and Poisson can now be used as likelihoods (see [#4675](https://github.com/pymc-devs/pymc3/pull/4675), [#4709](https://github.com/pymc-devs/pymc3/pull/4709) and
11+
[#4720](https://github.com/pymc-devs/pymc3/pull/4720)).
1112

1213
## PyMC3 3.11.2 (14 March 2021)
1314

Diff for: pymc3/distributions/bart.py

+8-7
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ def __init__(
2828
self,
2929
X,
3030
Y,
31-
m=200,
31+
m=50,
3232
alpha=0.25,
3333
split_prior=None,
3434
inv_link=None,
@@ -67,11 +67,12 @@ def __init__(
6767
if inv_link is None:
6868
self.inv_link = self.link = lambda x: x
6969
elif isinstance(inv_link, str):
70-
# The link function is just a rough approximation in order to allow the PGBART sampler
71-
# to propose reasonable values for the leaf nodes.
7270
if inv_link == "logistic":
7371
self.inv_link = expit
74-
self.link = lambda x: (x - 0.5) * 10
72+
# The link function is just a rough approximation in order to allow the PGBART
73+
# sampler to propose reasonable values for the leaf nodes. The regularizing term
74+
# 2 * self.m ** 0.5 is inspired by Chipman's DOI: 10.1214/09-AOAS285
75+
self.link = lambda x: (x - 0.5) * 2 * self.m ** 0.5
7576
elif inv_link == "exp":
7677
self.inv_link = np.exp
7778
self.link = np.log
@@ -302,8 +303,8 @@ class BART(BaseBART):
302303
m : int
303304
Number of trees
304305
alpha : float
305-
Control the prior probability over the depth of the trees. Must be in the interval (0, 1),
306-
altought it is recomenned to be in the interval (0, 0.5].
306+
Control the prior probability over the depth of the trees. Even when it can takes values in
307+
the interval (0, 1), it is recommended to be in the interval (0, 0.5].
307308
split_prior : array-like
308309
Each element of split_prior should be in the [0, 1] interval and the elements should sum
309310
to 1. Otherwise they will be normalized.
@@ -317,7 +318,7 @@ class BART(BaseBART):
317318
otherwise it does not have any effect.
318319
"""
319320

320-
def __init__(self, X, Y, m=200, alpha=0.25, split_prior=None, inv_link=None, jitter=False):
321+
def __init__(self, X, Y, m=50, alpha=0.25, split_prior=None, inv_link=None, jitter=False):
321322
super().__init__(X, Y, m, alpha, split_prior, inv_link)
322323

323324
def _str_repr(self, name=None, dist=None, formatting="plain"):

0 commit comments

Comments
 (0)