Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Multiphase Monte Carlo Sampling #147

Merged
merged 89 commits into from
Oct 3, 2021
Merged

Conversation

TolisChal
Copy link
Member

@TolisChal TolisChal commented Mar 16, 2021

This PR implements a Multiphase Monte Carlo Sampling (MMCS) algorithm that unifies sampling with distribution isotropization. The PR contains:

-- A C++ implementation of a single step of MMCS
-- A C++ class to update the Effective Sample Size for each new generated chain
-- A C++ implementation for the estimator of autocovariance in "Charles J. Geyer, Practical Markov Chain Monte Carlo, Statistical Science 1992."
-- New burn-in routines for Billiard Walk.
-- Two C++ examples to illustrate the new method.

This PR depends on #142 and #144

TolisChal added 30 commits March 6, 2021 22:57
Copy link
Member

@vissarion vissarion left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great, thanks! I have only a few comments.

@@ -7,6 +7,7 @@

//Contributed and/or modified by Apostolos Chalkis, as part of Google Summer of Code 2018 program.


Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

many files have this empty line insertion, could you undo these changes?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done in root/R-proj folder


NT variance = (normalized_samples.cwiseProduct(normalized_samples)).sum();
variance *= (1.0 / N);
variance += NT(1e-16)*(samples_mean*samples_mean);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what is the purpose of this computation? why 1e-16? Is this some magic number that simply works?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, it was added to avoid numerical overflow in case where (normalized_samples.cwiseProduct(normalized_samples)).sum() is zero.

Now I use const NT eps = 1e-16;

@@ -173,15 +248,15 @@ struct AcceleratedBilliardWalk
T -= _lambda_prev;
P.compute_reflection(_v, _p, _update_parameters);

while (it <= 100*n)
while (it <= 1000*n)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what is the reason behind this change? stability?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Better performance in the initialization of the parameters when we have very skinny polytopes.

Now I use unsigned int _rho = 1000*n;

>
void perform_mmcs_step(Polytope &P,
RandomNumberGenerator &rng,
const unsigned int &walk_length,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should this be unsigned int const& as below ?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

unsigned int &total_samples,
unsigned int const& num_rounding_steps,
MT &TotalRandPoints,
bool &complete,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think is is clearer if this functions returns this bool and below you simply return true or false instead of setting this variable and return void.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

unsigned int &total_samples,
unsigned int const& num_rounding_steps,
MT &TotalRandPoints,
bool &complete,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same as above

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

@vissarion vissarion added the dingo label Oct 1, 2021
@vissarion vissarion merged commit eb74ba3 into GeomScale:develop Oct 3, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants