Correlated priors update
I've run into a use case where I need correlated priors, so I've revived this MR. I changed the CorrelatedUniform
class so that both the width and the center of the distribution can depend on the other sampled variables instead of just the mean (this was a change that I specifically needed for my analysis). I also had to edit the prior check in the base_sampler
since any time the sample
method was called, it was done in a loop over keys instead of calling the method of the PriorSet
, and you can't sample individual keys for a correlated set. I also made some changes to the rescale
, prob
, and ln_prob
methods of the CorrelatedPriorDict
since they didn't seem to be returning numerical values.
@moritz.huebner if you could take a look and see if this is sufficiently in the spirit of your original MR, that would be great. I also merged in version 0.5.6 so lots of the base code is pretty different. If it's easier for me to submit a MR directly into master let me know. For what it's worth, I'm able to successfully run the sampler with this version of the code
Merge request reports
Activity
added 47 commits
- e390046d - Update utils.py: remove the sqrt(2) normalisation from the scalar longitudinal mode
- 03e91d1b - Prior json format
- c08d62b8 - Merge branch 'prior_to_json' into 'master'
- b2108893 - GW170817 in open_data_examples
- ee15712a - Merge branch 'GW170817_example' into 'master'
- e5fb6333 - Revert changes to the default settings
- e072a70f - Merge branch 'change-default-settings' into 'master'
- 8cb8cd3a - Conversion compatibility
- b96e42e4 - Merge branch 'conversion-compatibility' into 'master'
- 8c1955e7 - Fix bug
- b5d12402 - Merge branch '304-organise-the-examples' into 'master'
- 20e2a687 - Added try except clause for building the lookup table
- b02e7935 - Merge branch 'fix_load_lookup_table' into 'master'
- 10417cda - replace removed scipy.interpolate.spline
- b7d10dbc - Merge branch 'update-interpolation' into 'master'
- fcc74d30 - Resolve #403 (closed)
- 89f6c4ae - Resolve issue with nightly CI breaking
- 75bb453d - Merge branch 'scalar-fix' into 'master'
- 9c15e3e9 - Resolve !398 (merged) ensures the emcee chains are down selcted correctly
- 7a54c735 - Merge branch '404-nightly-c-i-breaking' into 'master'
- 49e1ac46 - Merge branch '398-emcee-chains-error' into 'master'
- ccb73408 - Merge branch '403-improve-validate-filename' into 'master'
- 16364c7c - Version 0.5.5 release
- cdb9de4c - Update sampler_requirements.txt: PyMC3 v3.7 is Python 3 compatible only, so change the requirements
- 169d8f41 - Merge branch 'pymc3version' into 'master'
- 73f47729 - Adds the LAL version information to the meta data
- 6415c788 - Merge branch 'add-lalapps-version-information-to-meta-data' into 'master'
- 3419800a - Update dynesty.py: catch ValueError raise by dynesty resample_equal function
- 8923927c - Fixing bug in dt
- 25539b62 - Merge branch 'timeshift' into 'master'
- 3894928f - Merge branch 'dynesty_traceplot_error' into 'master'
- 26b2b43d - Deprecates some of the problematic helper functions
- 82a376e9 - Merge branch 'deprecate-helper-functions' into 'master'
- 500babfd - Fixup documentation
- 6075aa71 - Merge branch 'fixup-documentation' into 'master'
- e2bda4ae - Fix reading of latex_labels in prior file to avoid multiple escape characters
- f76d9c34 - Merge branch 'repr_fix' into 'master'
- f42628ce - prior.py: fix for MultivariateGaussianDist
- c5a03a6c - make info message a debug
- a80b6de4 - Merge branch 'make-info-statement-debug' into 'master'
- 19fddb2f - Merge branch 'mvn_1d_fix' into 'master'
- 61740404 - Version 0.5.6 release
- e1bbab27 - Fixed issue with mutable default argument
- ffc85a5d - Merge branch 'fix_grid_dict_default' into 'master'
- f8ef7213 - Fix missing default kwarg in cpnest
- 0af57393 - Merge branch 'add-periodic-checkpoint-to-cpnest' into 'master'
- 40a41ee7 - Add axis argumant to ln_prob and don't cast result.prior to PriorDict
Toggle commit list@sylvia.biscoveanu I haven't looked at my original code in ages. I can have a closer look next week.
changed milestone to %0.5.7
added Feature-request + 1 deleted label
changed milestone to %0.5.8
@sylvia.biscoveanu and @moritz.huebner is this ready to be merged?
@sylvia.biscoveanu I think this looks good. I am not familiar anymore with all of the details of what I did back when I started working on this. Do you mind if I just merge this manually into my branch? I still think we need to make some changes before we move this into master.
@gregory.ashton I just updated my old MR so that there are no more merge conflicts. This MR is requested to go into my original branch. I would still like to make some changes on that.
Okay, @sylvia.biscoveanu I'm guessing you are now using this for something so @moritz.huebner whatever further changes you make should be coordinated if possible so as to not break Sylvia's current work.
Can you both coordinate on getting a single MR ready, I think this will be a really nice feature to have.
@gregory.ashton I think we should mostly add some tests, good tutorial and make sure this does not clutter up too much unrelated code.
Yeah, there are a few reasons I didn't want to merge to master right away. I didn't add much to the tutorial except changes needed to get it to run successfully. Also, I'm currently saving the
correlation_function
as a string when the results file is written to json, mostly because this was fast and I wanted it to work for my analysis. There's probably a much more elegant way to do this though, maybe along the same lines as how the nested priors are saved in theAlignedSpin
class. The other issue is I'm not sure how this type of prior could event be loaded from a.prior
file, since you also need to define and pass acorrelation_function
. Maybe @moritz.huebner and I can iterate offlineOkay sounds good. Can you decide between you to keep either this or !332 (merged) open and close the other :)
I'll put this to future for now.
changed milestone to %Future