Hello,
I have recently had some doubts regarding conducting inference via. the posterior or the posterior predictive, rooted from this thread in particular regarding posterior_predict and the average treatment effect and also a warning in rstanarm’s documentation regarding conducting inference via. the posterior_linpred() function vs. the posterior_predict() function.
Consider the scenario where we wish to conduct inference on the population median. For this scenario, let’s say I have assumed an exponential likelihood (and for simplicity sake, let’s say I assume some arbitrary proper priors). The exponential distribution has a closed-form solution for the median: \frac{ln2}{\lambda}.
I can see two ways of conducting inference on the population median:
- Simply calculate:
for every sample from \text{Pr(}\lambda | D)
OR
- Simulate from the posterior predictive M times, and then take the sample median of each of the M samples to get M samples of the median.
Is the warning in rstanarm’s documentation alluding to using algorithm 2) instead of algorithm 1), where the posterior predictive is encouraged rather than just the posterior?
Intuitively, I think both algorithms should give approximately the same thing for a large number of samples, though perhaps 1) is more efficient than 2) because 2) is non-parametric. Additionally, I would imagine that 2) produces wider intervals in general, because simulating from the posterior predictive will incorporate additional residual uncertainty. If we wish to fully incorporate both parameter and residual uncertainty, then I can see why 2) would actually be preferred if what I am saying is true.
Is one approach preferable to the other/blatantly incorrect? Am I completely on the wrong track here?
Thanks in advance!
EDIT: Looks like I was just confusing the two distributions: \text{Pr(median |} \lambda) vs \text{Pr(median | D)}, though I’d still be interested to hear more thoughts on this to make sure.