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

WIP: replace Prior and posterior samples with ParameterDistributions #89

Merged
merged 12 commits into from
Dec 15, 2020

Conversation

odunbar
Copy link
Collaborator

@odunbar odunbar commented Dec 8, 2020

Purpose

To follow from PR #88 in replacing the prior distributions and posterior distributions with the new type ParameterDistributions, and adding the requisite functionality to make this possible.

Contained in the PR

  • Implement methods: get_logpdf, get_cov,get_mean and replace implementation in EKP, and MCMC. Note this will also allow us to use prior distributions with block diagonal (i.e not only diagonal) in the MCMC.
  • Add requisite unit tests
  • Modify runtests.jl that are dependent on Priors.jl, to instead use ParameterDistributions
  • Remove Priors.jl

Future PR will deal with example cases (not contained in runtests)

Additionally

  • Created the following issue: When creating EKS, before one supplied mean and cov separately, these can now be deduced from the prior (which is also an input).

@codecov
Copy link

codecov bot commented Dec 9, 2020

Codecov Report

Merging #89 (acd127b) into master (76562c6) will increase coverage by 5.37%.
The diff coverage is 98.07%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master      #89      +/-   ##
==========================================
+ Coverage   79.81%   85.19%   +5.37%     
==========================================
  Files           8        7       -1     
  Lines         540      547       +7     
==========================================
+ Hits          431      466      +35     
+ Misses        109       81      -28     
Impacted Files Coverage Δ
src/CalibrateEmulateSample.jl 100.00% <ø> (ø)
src/ParameterDistribution.jl 98.82% <97.67%> (-1.18%) ⬇️
src/EKP.jl 80.48% <100.00%> (-1.34%) ⬇️
src/MCMC.jl 85.43% <100.00%> (+9.73%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 76562c6...acd127b. Read the comment docs.

@odunbar odunbar requested a review from bielim December 15, 2020 12:31
@odunbar
Copy link
Collaborator Author

odunbar commented Dec 15, 2020

Recieved a review offline from @bielim . Merging

@odunbar
Copy link
Collaborator Author

odunbar commented Dec 15, 2020

bors r+

@bors bors bot merged commit 35eef88 into master Dec 15, 2020
@bors
Copy link
Contributor

bors bot commented Dec 15, 2020

Build succeeded:

@bors bors bot deleted the orad/interface-parameter-distributions branch December 15, 2020 22:14
bors bot added a commit that referenced this pull request Dec 22, 2020
94: Update examples to work with the latest CES code r=bielim a=bielim

The goal of this PR is to get all examples synced up with the latest changes in the code base (in particular, PRs  #88 and #89)

- [x]  `Cloudy_example.jl`
- [x]  `learn_noise.jl`
- [x] `plot_GP.jl`

In addition, `get_distribution()` (in `ParameterDistribution.jl`) has been modified to return the array of samples when called for `Samples` ( rather than the message "Contains samples only"). `get_distribution` now returns a `Dict` with the parameter names as keys and the corresponding distribution (in the case of `Parameterized` distributions, such as Normal(0.0, 1.0)) or the corresponding samples (in the case of parameters represented by `Samples`) as a parameter_dimension x n_samples array.

Co-authored-by: Melanie <[email protected]>
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.

2 participants