How to use sample_posterior_predictive for out-of-sample prediction with BART?

Hi, yiy-z.

However, I still cannot figure out how to do out-of-sample prediction using sample_posterior_predictive(), I’m also using the pmb.predict() for out-of-sample predictions currently.
I also wonder why sample_posterior_predictive() seems to be faster than pmb.predict(). Could you please share some thoughts with me on this?

I guess that sample_posterior_predictive() maybe product result without calling pmb.predict().
To be honest, I don’t know much about inside of this exactly.

I see that in your post, you asked about is it correct that we do not use the whole posterior distribution. I’m not sure if you mean that the current pmb.predict() only gives us miu_pred but not sigma_pred, or that we do not use all the draws. If it’s the later one, I think it’s fine as long as we use a reasonable size for pmb.predict().

Note that in this case we assumpted that likelihood function is the normal distribution so we actually estimated the miu’s and sigma’s posterior distribution of the parameters of Gaussian distribution.

Aloctavodia confirmed that pmb.predict() gives only samples from BART’s posterior as posterior distribution of miu.
We actually have to use samples generated from the whole posterior distribution to predict new data with probability.
So pmb.predict()'s result is not enough to predict with probability.
To begin with, we assumpted that likelihood function is the normal distribution.
Why not using sigma? :laughing:

But we can’t use this method with the BART of current version, so we have to get the result of samples from posterior distribution by these code.

Sorry for my poor English.
Thanks.

1 Like