Two related questions, either one of which would solve my problem:
For teaching/demonstration purposes, I'd like to illustrate how the posterior changes when different priors are chosen for the same data, mostly to illustrate the sensitivity (or lack thereof) of the posterior to the choice of a prior.
1. Is there a way to overlay the output of different bayesgraph histograms on one another? (I could then do this for different choices of prior distributions.)
2. Is there a way to add the prior to bayesgraph histograms?
Example:
Thanks in advance!
For teaching/demonstration purposes, I'd like to illustrate how the posterior changes when different priors are chosen for the same data, mostly to illustrate the sensitivity (or lack thereof) of the posterior to the choice of a prior.
1. Is there a way to overlay the output of different bayesgraph histograms on one another? (I could then do this for different choices of prior distributions.)
2. Is there a way to add the prior to bayesgraph histograms?
Example:
Code:
sysuse auto, clear * model 1 w/ prior N(0,1) bayes, prior({mpg}, normal(0,1)): regress price mpg * model 2 w/ prior N(10, 30) bayes, prior( {mpg} , normal(10,30) ): regress price mpg * model 3 w/ prior t(2,6) bayes, prior( {mpg}, t(2,6)): regress price mpg * Here it would be nice to do something like * bayesgraph histogram {price:mpg}, overlay( ... prior distribution ...) *OR something like: * bayesgraph histogram {price:mpg_model 1} {price:mpg_model 2} {price:mpg_model 3}
Thanks in advance!