Set default values of constants in white_noise_block#226
Set default values of constants in white_noise_block#226mattpitkin wants to merge 3 commits intonanograv:masterfrom
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #226 +/- ##
=======================================
Coverage 37.29% 37.29%
=======================================
Files 20 20
Lines 3974 3974
=======================================
Hits 1482 1482
Misses 2492 2492
Continue to review full report in Codecov by Sentry.
|
|
Hi @mattpitkin, Sorry you do not get much of a response here. Although I don't really use (or maintain?) e_e, it seems I'm the only one here regardless. Two remarks. Firstly, it can also be thought of as a feature that Enterprise will fail if the white noise parameters are not set. In Enterprise, the (white) noise parameters are set with the function I understand your desire to have the white noise parameters default to efac=1. But because of the above, I would not just change the defaults. It's dangerous, and someone somewhere sometime will make a pretty nasty mistake. Perhaps you can modify the PR so that there is an option? May set vary='efac_is_one' or something more elegant for that? Secondly, is Enterprise happy with the -np.inf? Will it just run without problems? Again, apologies that you don't get a response here. |
- allow constants to be initialised with user provided values
|
Hi @vhaasteren, thanks for having a look at this. As you suggested, I've updated the PR so that you can now instead provide some default constant values via keyword arguments, but otherwise it will function as before. |
|
Thanks @mattpitkin , this looks fine. I'm tempted to just merge, but perhaps better to still wait for tests to pass. The reason the tests fail at the moment are because of libstempo/tempo2 actually. In PR #248 I made a change that will make libstempo/tempo2 optional, so then the CI will run, but someone will need to approve it first. Actually, since you do some libstempo maintenance, do you know how to fix that? |
Currently, in the
white_noise_blockfunction, ifvary=Falsetheefac,equadandecorrvalues are set asConstantparameters without a given value for that constant. This means that the constant value will default toNone. The docstring suggests that the constant values can be set later, but in a function such asmodel_singlepsr_noise, ifwhite_vary=Falsethese constants don't get set and subsequent likelihood calls on the returnedptaobject fail due to the constants returningNone.This PR attempts to fix this by setting some default values for the constants. In this case a value of
1.0forefacand-inffor bothequadandecorr. This (assuming I understand things correctly!) would mean that the likelihood just uses the TOA errors as given as the standard deviations in the likelihood calculation (without any scaling, additional component, or correlation).See also nanograv/enterprise#379.