theodds / SoftBART

30 stars 9 forks source link

About computing the transition probability in MH step #2

Closed yanq2018 closed 2 years ago

yanq2018 commented 4 years ago

Hi, I have a small question about the MH step in "node_birth" function (line 640) of soft_bart.cpp. When computing the forward transition probability and the reverse one, I can only find the probability of extending a random leaf node or killing a leaf node, but cant find the probability of selecting splitting variables and mu values. Do I miss something? Thanks!

theodds commented 4 years ago

The way it is implemented these are not needed. In the case of selecting the splitting proportion, as long as we propose a splitting coordinate according to the splitting probability vector s, the contribution will get canceled with its contribution in the tree likelihood. If you wanted to propose new splits according to a probability other than s then you would indeed need to take this into account.

The leaf node parameters (the mu member of the node) are integrated out to get the marginal tree likelihood, so you don't need those either - that is actually key to almost all BART implementations. The leaf parameters are then updated from their full conditional after the transition. But perhaps you mean the split cut points (the val member of a Node)? Those are also not needed, but the explanation for why is a little bit technical, and there are valid transitions you can construct that do include taking them into account. I agree it might look fishy at first, but it is OK. I double-checked the original BayesTree package and they are also doing this.

theodds commented 4 years ago

Also happy to give additional details if you want! But the point is that the omission of these factors in the update is intentional and (unless I've made a huge blunder) justified.

yanq2018 commented 4 years ago

Thanks for your helpful response! And yes, if you have other materials or details to help me further understand that, I would be appreciated.

theodds commented 4 years ago

The bartMachine (Journal of Statistical Software) paper does a good job of deriving transition probabilities, and should convince you that s and mu don’t need to be accounted for. The transitions there are correct, but also involve the number of possible splits for each predictor; this term is unnecessary (that is, you still have a valid transition if you ignore it) but I’m not aware of a place in the literature that shows this. The original Bayesian CART paper (1998 in JASA by Chipman et al) reached this conclusion (e.g., they note that the transition ratio for CHANGE is always 1, unlike the bartMachine derivation, and, as I mentioned, they ignore it in BayesTree) but unfortunately they are a bit vague on why it is the case and I’m not familiar with anywhere else in the literature that goes into this.

yanq2018 commented 4 years ago

Thanks! I'll look into that. Another issue I am confused about is that in "GetSuffStats" (line 238), you mentioned Omega_inv is the posterior covariance, while I was wondering if it is the inverse covariance, i.e, the precision matrix. And during sampling, like rmvnorm function, should we use the inverse of that matrix as cov argument? Again, thanks for your patience to Answer my question. Recently I was trying to understand the logic of building bayesian tree model, it is nice to have someone to discuss.

theodds commented 4 years ago

I believe that Omega_inv is actually the precision, based on what I'm seeing in the code. And Omega is the covariance.