Skip to content
Snippets Groups Projects

General fix up of priors

Merged Gregory Ashton requested to merge updating-priors into master

Things this MR will include

  • Make a PriorSet class which is a dictionary containing the priors
  • Add a method to read in a PriorSet from file
  • Move the BBH default priors to a text file which is read in to a super PriorSet of default priors
  • Allow users to choose there default priors file (or a default will be chosen, maybe even based on the source model?)
  • Ensure that gw and core don't overlap anymore

@colm.talbot @paul-lasky @moritz.huebner feel free to chip in (and anyone else of course).

Edited by Gregory Ashton

Merge request reports

Loading
Loading

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
  • Gregory Ashton marked the checklist item Make a PriorSet class which is a dictionary containing the priors as completed

    marked the checklist item Make a PriorSet class which is a dictionary containing the priors as completed

  • Gregory Ashton added 2 commits

    added 2 commits

    • c87f5fd1 - Add a read method for the prior set
    • 52333aea - Update uniform prior to use scipy.stats functions

    Compare with previous version

  • Gregory Ashton marked the checklist item Add a method to read in a PriorSet from file as completed

    marked the checklist item Add a method to read in a PriorSet from file as completed

  • Gregory Ashton added 1 commit

    added 1 commit

    Compare with previous version

  • Gregory Ashton marked the checklist item Move the BBH default priors to a text file which is read in to a super PriorSet of default priors as completed

    marked the checklist item Move the BBH default priors to a text file which is read in to a super PriorSet of default priors as completed

  • Gregory Ashton added 2 commits

    added 2 commits

    • ff805de9 - Major fix up to priors
    • 7ca83bfc - Minor clean up and ensure priors are loaded

    Compare with previous version

  • Gregory Ashton added 1 commit

    added 1 commit

    Compare with previous version

  • Gregory Ashton added 2 commits

    added 2 commits

    • d08e0572 - Expose the default_priors_file to the run_sampler method
    • 2b45350c - Update documentation for priors

    Compare with previous version

  • Gregory Ashton marked the checklist item Allow users to choose there default priors file (or a default will be chosen, maybe even based on the source model?) as completed

    marked the checklist item Allow users to choose there default priors file (or a default will be chosen, maybe even based on the source model?) as completed

  • Gregory Ashton unmarked as a Work In Progress

    unmarked as a Work In Progress

  • Gregory Ashton changed the description

    changed the description

  • Gregory Ashton added 13 commits

    added 13 commits

    Compare with previous version

  • mentioned in issue #61 (closed)

  • I'm done with this now. It doesn't change any functionality, but should make it easier in future if we want other default priors etc. Any objections to merging this in @colm.talbot @moritz.huebner ?

    Things to do

    • Create a PriorSet (class containing all the Priors)
    • Updates Uniform prior to not use the PowerLaw. This printed an alpha=0 parameter which broke reading in priors (and is also confusing).
  • Colm Talbot added 3 commits

    added 3 commits

    Compare with previous version

  • I like the idea of using .prior files, shall we make the prior print to label.prior? We could also add a catch of adding .prior to the given filename.

    I've touched up the LogUniform prior, this is how I would have rewritten the Uniform prior (it doesn't print alpha=-1), but your way definitely works.

    I've added sample and rescale functions to the PriorSet. I think we can use the rescaling in the sampler if we convert the given prior to a PriorSet.

    I'm happy to merge at this stage although I'm going to keep working on this branch for the following reasons.


    I'd really like to make the core independent of the gw. I think there are only a few things we need to do.

    • Remove the GW specific default latex labels from core, this method can be overwritten in gw.

    • Move the binary_black_holes.prior from core to gw?

    • Have an empty PriorSet.test_redundancy which just does nothing which can be overwritten by whichever prior set you like, this will naturally be done by defining a subclass of PriorSet in gw/prior.py.

    • Make create_default_prior require the second argument.

    I'm happy to take over and do these things.

  • Okay fine by me if you take over (either merge and create a new MR or continue on this one). A few minor comments

    1. I think we should passively use the .prior filetype. There's no reason to insist that people name them .prior, it should just as well read prior.txt (but all the ones we write can be .prior to make it clear?)

    2. We could move move everything currently in core/prior_files to gw/prior_files (or something similar). We'd also need to fix the setup.py file to see this, but its all gw-specific.

    3. Definitely like the idea of an empty test_redundancy.

    4. I'm not at all tied to the way I implemented Uniform, it was just the first thing that came to my mind. If you prefer to have everything be done in some consistent fashion that is fine, it just needs the printed version to be executable (i.e. when you read it back in from the string it makes the same Prior type with the same prior args).

  • Merging what we have.

  • Colm Talbot mentioned in commit 68a2b920

    mentioned in commit 68a2b920

  • merged

  • Colm Talbot mentioned in merge request !59 (merged)

    mentioned in merge request !59 (merged)

Please register or sign in to reply
Loading