brian-j-smith / Mamba.jl

Markov chain Monte Carlo (MCMC) for Bayesian analysis in julia
Other
253 stars 52 forks source link

Dirichlet Process simple example #125

Open gcgibson opened 7 years ago

gcgibson commented 7 years ago

Not sure if this example is useful in this form, please let me know if I can adapt it to something, or if you don't even want a DP example feel free to close.

brian-j-smith commented 7 years ago

Yes, this example would be useful to include in the package documentation, and I would be happy to do so. Before merging the pull request, I have a couple questions about the example:

  1. In the math section of the documentation there is a tau scale parameter in the Normal distribution for y and a sigma^2 parameter in the Normal for mu; whereas, in the implementation, tau is the scale parameter for both Normals. Was the intent to have them be the same (as implemented) or to have separate ones for the two distributions (as documented)? Also note that the Distributions package parameterizes its Normal in terms of the standard deviation and thus the sigma^2 parameter in the math section of the example would be interpreted as a standard deviation.

  2. Is the sigma field in the NewUnivarDist intended to be a standard deviation? If so, it should either be squared in the sqrt of the normalizing constant of the logpdf function or pulled outside of the sqrt.

Thanks.

bdeonovic commented 7 years ago

Also I think all (or most?) of the examples use real data rather than simulation so maybe we should consider sticking to that standard.

gcgibson commented 7 years ago

@bdeonovic That sounds good to me! How about the old faithful data? here

I have seen that used in a couple GMM examples, would that make sense to you?

bdeonovic commented 7 years ago

Old faithful would be a good data set for GMM (it is basically two clusters if I rememeber correctly, is that right?) another good data set is the iris data set