Add a toggle to scale and shift pulsar distances in the CW delay model #238
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
enterprise_extensions.deterministic.cw_delay
uses thep_dist
keyword argument to take in pulsar distance parameters, which are necessary for correctly including the pulsar term in the model. Currently, the model is hard-coded to scale and shift the input pulsar distance parameters by the mean and uncertainty of the pulsar distance attribute within the enterprisePulsar
object.This functionality makes sense if you want to use a generic parameter as input, e.g. a Gaussian prior with zero mean and unit variance, and then scale that prior distribution by the values in the
Pulsar
object. However, with more sophisticated priors such as those in QuickCW it might be easier for users to calibrate all the initial prior distributions with pulsar distance means and variances in a separate script instead of using the distances in thePulsar
object itself. In this case there is no need to scale and shift the input prior. However, this scaling and shifting is hard coded, so the input distance parameters might be unintentionally affected depending on what is in thePulsar
.The current workaround to avoid incorrect pulsar distance priors is to assign zero-mean and unit-variance values to the pulsar distance attribute in the
Pulsar
object. While this works, this PR implements a simpler and more user-friendly solution, which is to include a toggle allow users to turn off the scaling-and-shifting behavior in thecw_delay
. Specifically, settingscale_shift_pdists=False
will just use the input pulsar distance priors without any additional changes, whilescale_shift_pdists=True
will keep the old behavior, and is kept as the default so this change is backwards compatible.