bayesmix-dev / bayesmix

Flexible Bayesian nonparametric mixture models in C++
https://bayesmix.rtfd.io
BSD 3-Clause "New" or "Revised" License
22 stars 18 forks source link

LapNIG hierarchy implementation #110

Closed taguhiM closed 2 years ago

taguhiM commented 2 years ago

In this PR you can find the implementation of Laplace - Normal Inverse Gamma model. All the code is up to date with the HEAD of origin/master of your library.

taguhiM commented 2 years ago

We added a small part for printing the acceptance rate for the MH in the run.mcmc. We can generalize it proposing a new argument in the argument parser, like --quiet.

mberaha commented 2 years ago

Before we go into depth for the code review, can you please upload some traceplots in the case of one single hierarchy? You can have a separate executable (or a unit test) where you generate data from a Laplace distribution and then run MCMC with only one hierarchy, so that we visually see if the MCMC is working.

EnricoPaglia commented 2 years ago

Yes we will do that, in the meanwhile these are some of the the density estimations we plotted to see what the code was producing

link link link

The first two are made on the tutorial dataset already present in the library with different values of the hyper parameters, the third one is the case of data generated from a single Laplace ditribution. To produce the densities we took the mean of the density estimated at each iteration in the output density file.

brunoguindani commented 2 years ago

Shall I wait until you make the changes proposed by @mberaha to give my review?

taguhiM commented 2 years ago

We're working on that right now. You can wait a little until we finish the changes. Thanks.

mberaha commented 2 years ago

I'm approving the CI tools, please also upload the requested check.

Can you also re-run all the examples (including the missing one with only one hierarchy) and upload the new results.

brunoguindani commented 2 years ago

Hello folks, I'm very busy these days. I will review the PR as soon as I can, maybe one of the next evenings.

taguhiM commented 2 years ago

I'm approving the CI tools, please also upload the requested check.

Can you also re-run all the examples (including the missing one with only one hierarchy) and upload the new results.

Thanks. We'll upload the new results soon.

EnricoPaglia commented 2 years ago

We will fix the things you pointed out as soon as we can, in the meanwhile these are the plots made after the last change. link link link link

The first two are the density estimations on the tutorial and galaxy data set, the last two are the plots of the MHMC on one hierarchy (of mean and log scale), the data was generated by a Laplace distribution of parameters (mean = 0, scale = 2) and the hyper parameters we used are: hypers->mean = 0; hypers->var = 1; hypers->shape = 2; hypers->scale = 1; hypers->mh_mean_var = 3; hypers->mh_log_scale_var = 1;

taguhiM commented 2 years ago

Sorry for the late response. We had some exams in this period.