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

Mcmc unitary tests #2584

Merged
merged 11 commits into from
Jun 3, 2024
Merged

Conversation

MerlinKeller
Copy link
Contributor

I added three unitary tests to the MCMC classes to the existing Python test files:

  • 2D normal target test to Gibbs class in t_Gibbs_std.py
  • test for IMH based on Beta-binomial model t_IndependentMetropolisHastings_std.py
  • test for RVMH based on Beta-binomial model t_RandomVectorMetropolisHastings_std.py

Copy link
Collaborator

@mbaudin47 mbaudin47 left a comment

Choose a reason for hiding this comment

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

Thank you for this significant improvement! Only minor changes will greatly improve these unit tests.

python/test/t_Gibbs_std.py Outdated Show resolved Hide resolved
python/test/t_Gibbs_std.py Outdated Show resolved Hide resolved
python/test/t_IndependentMetropolisHastings_std.py Outdated Show resolved Hide resolved
python/test/t_IndependentMetropolisHastings_std.py Outdated Show resolved Hide resolved
python/test/t_RandomVectorMetropolisHastings_std.py Outdated Show resolved Hide resolved
python/test/t_RandomVectorMetropolisHastings_std.py Outdated Show resolved Hide resolved
python/test/t_IndependentMetropolisHastings_std.py Outdated Show resolved Hide resolved
python/test/t_IndependentMetropolisHastings_std.py Outdated Show resolved Hide resolved
python/test/t_RandomVectorMetropolisHastings_std.py Outdated Show resolved Hide resolved
@josephmure
Copy link
Collaborator

I don't understand the error which occurs:

/home/devel/project/lib/test/t_RandomVectorMetropolisHastings_std.cxx:72:30: error: parentheses were disambiguated as a function declaration [-Werror=vexing-parse]
   72 |     RandomVector randomVector(Normal());
      |                              ^~~~~~~~~~
/home/devel/project/lib/test/t_RandomVectorMetropolisHastings_std.cxx:72:30: note: replace parentheses with braces to declare a variable
   72 |     RandomVector randomVector(Normal());
      |                              ^~~~~~~~~~
      |                              -
      |                              {        -
      |                                       }
/home/devel/project/lib/test/t_RandomVectorMetropolisHastings_std.cxx:73:63: error: no matching function for call to ‘OT::RandomVectorMetropolisHastings::RandomVectorMetropolisHastings(OT::RandomVector (&)(OT::Normal (*)()), <brace-enclosed initializer list>)’
   73 |     RandomVectorMetropolisHastings sampler(randomVector, {0.0});

@MerlinKeller MerlinKeller changed the base branch from master to 1.23 May 7, 2024 11:26
@MerlinKeller
Copy link
Contributor Author

MerlinKeller commented May 7, 2024

@jschueller : this PR can now be merged into the 1.23 branch imo ! After the reviewer's approval...

@josephmure josephmure added this to the 1.23 milestone May 20, 2024
@mbaudin47
Copy link
Collaborator

@jschueller : This PR is ready for merging. Can you please review or merge?

@jschueller jschueller changed the base branch from 1.23 to master June 3, 2024 08:45
@jschueller jschueller merged commit 3bc622f into openturns:master Jun 3, 2024
9 checks passed
@josephmure josephmure deleted the MCMC_unitary_tests branch June 3, 2024 10:40
@jschueller jschueller removed this from the 1.23 milestone Jun 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants