-
Notifications
You must be signed in to change notification settings - Fork 70
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
Linear interpolated FFT-based time-correlated signals #411
base: dev
Are you sure you want to change the base?
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## dev #411 +/- ##
==========================================
+ Coverage 71.53% 72.53% +1.00%
==========================================
Files 13 13
Lines 3246 3401 +155
==========================================
+ Hits 2322 2467 +145
- Misses 924 934 +10
Continue to review full report in Codecov by Sentry.
🚀 New features to boost your workflow:
|
…ation
…tart_time)
This PR introduces the linear interpolated FFT-based rank reduced time-correlated signals. These replace the diagonal Phi matrix approach that Enterprise has traditionally used based on the Lentati et al. (2013) method.
Using it is pretty simple. Instead of:
one would do:
so the same spectral function can be used. Free spectrum is NOT supported yet. Instead of
components
, we can also passknots=
, where it is understood thatknots=2*n_components+1
. This is becausecomponents
actually means frequencies. In the time-domain, the number ofknots
is the number ofmodes+1
, because we cannot just omit the DC term.The
oversample
parameter determines how densely the PSD is sampled in frequencies. Withoversample=1
we would use frequencies at spacing ofdf=1/T
. Withoversample=3
(the default), the frequency spacing isdf=1/(3T)
. Note that this is a way to numerically approximate the Wiener-Khinchin integral. With oversample sufficiently large, the FFT is an excellent approximation of the analytical integral. For powerlaw signals,oversample=3
seems a very reasonable choice.The
cutoff
parameter is used to specify below which frequencyfcut = 1 / (cutoff*Tspan)
we set the PSD equal to zero. Note that this parameterization (which is also in Discovery) is a bit ambiguous, asfcut
may not correspond to an actual bin of the FFT: especially ifoversample
is not a high number this can cause a mismatch. In case of a mismatch, fcut is rounded up to the next oversampled-FFT frequency bin. Instead ofcutoff
, the parametercutbins
can also be used (this overridescutoff
). Withcutbins
the low-frequency cutoff is set at:fcut = cutbins / (oversample * Tspan)
, and its interpretation is less ambiguous: it is the number of bins of the over-sampled PSD of the FFT that is being zeroed out.For common signals, instead of:
one would do:
DM-variations and Chromatic noise can be similarly set up:
Subtleties
Enterprise allows one to combine basis functions when they are the same. This
is especially useful when analyzing common signals which have the same basis as
a single-pulsar signal, such as one would have with red noise and a correlated
GWB. This can be done with the
combine=True
option inFFTBasisGP
andFFTBasisCommonGP
. Default iscombine=True
. The subtlety is that modern PTAdatasets typically have large gaps, which causes some of the time-domain basis
functions to basically be all zeros. Therefore, some basis functions that you
would not expect to be identical will be combined.
The above is not a bug. Combining such bases and the corresponding Phi matrix
does not matter, because the basis is zero, and that part of the signal has no
bearing on the data or the model. However, when doing signal reconstruction,
such as with
la_forge
orutils.ConditionalGP
, make sure to setcombine=False
.Extra comment
An additional re-design of certain patterns is needed to accelerate TNT construction using sparse matrices for faster single pulsar noise analysis. Because of the severity of changes, that will be a different PR.