Robust semicoherent searches for continuous gravitational waves with noise and signal models including hours to days long transients

The vulnerability to single-detector instrumental artifacts in standard detection methods for long-duration quasimonochromatic gravitational waves from nonaxisymmetric rotating neutron stars [continuous waves (CWs)] was addressed in past work [D. Keitel et al., Phys. Rev. D 89, 064023 (2014).] by a Bayesian approach. An explicit model of persistent single-detector disturbances led to a generalized detection statistic with improved robustness against such artifacts. Since many strong outliers in semicoherent searches of LIGO data are caused by transient disturbances that last only a few hours, we extend the noise model to cover such limited-duration disturbances, and demonstrate increased robustness in realistic simulated data. Besides long-duration CWs, neutron stars could also emit transient signals which, for a limited time, also follow the CW signal model (tCWs). As a pragmatic alternative to specialized transient searches, we demonstrate how to make standard semicoherent CW searches more sensitive to transient signals. Considering tCWs in a single segment of a semicoherent search, Bayesian model selection yields a new detection statistic that does not add significant computational cost. On simulated data, we find that it increases sensitivity towards tCWs, even of varying durations, while not sacrificing sensitivity to classical CW signals, and still being robust to transient or persistent single-detector instrumental artifacts.


I. INTRODUCTION
Among the main search targets of terrestrial interferometric detectors [1][2][3][4][5] are continuous gravitational waves (CWs): periodic, narrow-band signals with a slow frequency evolution, emitted by rotating neutron stars with nonaxisymmetric deformations. [6,7] Searches for CWs from unknown sources over wide parameter spaces are usually performed with semicoherent methods. [8][9][10][11] For these, the data are split into several segments, each spanning part of the observation time. Each segment is analyzed coherently, and the resulting per-segment detection statistics are combined incoherently, e.g., by a sum. At fixed computational cost, semicoherent methods are generally more sensitive than fully coherent searches. [8,9,12] Even though gravitational-wave (GW) detectors are highly precise instruments, they still produce complicated data sets with many noise components. These are not all fully modeled by existing data analysis procedures, and thus result in outliers of the detection statistics. To distinguish noise outliers from real signals, a lot of work is routinely invested in detailed investigation of search results and auxiliary data. Some of it can be saved * david.keitel@ligo. by modifying detection methods to produce less outliers in the first place. [13] Many outliers in CW searches are caused by socalled lines, narrow-band disturbances that are typically present for a sizable fraction of the observation time.
Such persistent lines can have diverse instrumental or environmental origins, such as harmonics of the electrical power grid frequency, of the detector's suspension system, or from digital components. [14][15][16][17][18][19] A separate class of noise artifacts are transient 'glitches' [16,[20][21][22] lasting only for a few milliseconds or seconds. These are mostly relevant in searches for transient GWs from compact-binary coalescences and 'burst'type events. However, there is a third class of intermediate 'transient' disturbances: they are much longer than glitches, so that they are highly relevant for CW searches; but still much shorter than the full observation time, so that they are not easily addressed by methods for mitigating persistent lines. Typical time scales range from less than an hour to at most a few days. 1 Such medium-duration transients, of a linelike quasimonochromatic type, were noticed in a semicoherent search for CWs from the Galactic center with two years of LIGO S5 data [24][25][26], based on the matched-filter F-statistic [27,28] and the global-correlations (GCT) semicoherent search method [11,29]. In that search, many strong outliers could be traced back to narrow-band disturbances in the data happening only within a single segment (each 11.5 hours long) of data from a single detector. Similar transient single-segment disturbances have also been found in LIGO S6 data, using 60-hour segments for one year of data. [30] In the Galactic-center search a permanence veto was introduced [24][25][26] to remove any candidates for which a single segment contributed excessively to the semicoherent multi-detector detection statistic. It was proven to be very effective, and also safe regarding classical CW signals, which are persistent over time scales comparable to the full length of the data set. [24][25][26] However, in a semicoherent CW search over several months of data, such a veto also suppresses nonpersistent signals with durations similar to a segment length, i.e., only a few hours or days: these would produce just the same data signature as a disturbance in terms of single-segment, multidetector statistics. Such 'transient-CW ' signals (tCWs), following the standard CW signal model but for a limited duration, are also considered viable candidates for detection [31,32], with several possible emission mechanisms from perturbed neutron stars [33][34][35][36][37][38].
Therefore, this paper investigates an alternative approach to the permanence veto, constructing a detection statistic that is robust against single-detector transient artifacts, while at the same time being more sensitive than standard statistics to transient signals that are coherent across multiple detectors.
Two methods for detecting medium-duration transient signals have been previously proposed. One approach is to extend a coherent F-statistic-based CW search to the case of tCWs by including their duration, start-time and shape as free parameters in the search grid. [31,32] This is nearly optimal in the Neyman-Pearson sense [39], but computationally expensive due to the increased dimensionality of the search space. 2 Alternatively, an unmodeled 'excess power' detection method originally used to search for GW bursts of at most a few seconds has recently been extended to cover longer durations. [23] While not specifically aimed at or optimized for tCWs, it could also be sensitive to this type of signal. Due to the different signal models, data processing and search methods of the CW-based and burst-based approaches, direct comparison of their tCW sensitivity is a difficult open question; and neither of these approaches has yet been used for an analysis of actual interferometer data.
In contrast, the approach in this paper is a pragmatic extension of the line-robust statistics of Ref. [13] (hereafter Paper I), which in turn are based on the standard matched-filter F-statistic [27,28]. The F-statistic is close to optimal as a detection statistic for persistent CWs in Gaussian noise [40], which in current detectors is a good model for the noise distribution over most of the observation time and frequency range. (See, e.g., Refs. [18,26,41].) In fact, the F-statistic corresponds to a binary hypothesis test between a CW signal hypothesis and a Gaussian-noise hypothesis. [40] In the line-robust statistics from Paper I, the noise model is extended to include persistent single-detector lines, without any detailed physical modeling of the lines' origin: the idea is to simply model a line as identical to a CW signal, but confined to a single detector. We summarize these developments in Sec. II.
In Sec. III of this paper, the new material begins with a further extension of the noise model that also includes transient disturbances -or, more specifically, single-segment, single-detector disturbances. With this approach, CW searches now become more robust towards both persistent and transient single-detector disturbances. It can reproduce the robustness of the permanence veto when considering persistent CW signals only, while not being as strict in suppressing transient tCW signals.
A second step, described in Sec. IV, aims to improve the sensitivity of semicoherent F-statistic-based searches towards transient signals, hence reducing the need for more specialized tCW searches. We achieve this by also including an explicit signal model for transient CW-like signals on a time-scale corresponding to a single segment in a semicoherent search. We then test these extended detection statistics in Sec. V, using simulated data with a realistic distribution of gaps in observation times, and conclude in Sec. VI. A comparison to other search methods for medium-duration transient GW signals [23,31,32] remains a topic for further work.

II. SUMMARY OF EXISTING SEMICOHERENT DETECTION STATISTICS
This section briefly summarizes previous work on how the matched-filter F-statistic [27,28] follows from Bayesian hypothesis testing [40], on the permanence veto [24][25][26], and on Paper I's extension of the Bayesian approach to produce line-robust detection statistics.
This section also serves as an introduction to the notation used in this paper. x X (t) denotes a time series of GW strain measured in a detector X. Following the multi-detector notation of [28,42], boldface indicates a multi-detector vector, i.e., x(t) is the multi-detector data vector with components x X (t).
For Bayesian hypothesis testing [43], P (H|x, I) is the probability of a hypothesis H given data x and prior information I. Posterior odds ratios between two hypotheses Also, in this paper semicoherent quantities from a search with a number N seg of segments carry a hat, such as F. Coherent single-segment quantities have a tilde above the symbol and an upper index = 1 . . . N seg enumerating the segments, such as F .
A. The F-statistic: signals in Gaussian noise We start with a Gaussian-noise hypothesis, H G : x(t) = n(t), with the samples of n(t) drawn from a Gaussian distribution. Its posterior probability, given priors P H G I and P (x|I), is with a normalization constant κ and a scalar product between time series defined as Here, S X are the single-sided power-spectral densities (PSDs), assumed as uncorrelated between different detectors and constant over the (narrow) frequency band of interest. The CW signal hypothesis contains a waveform with a set A of four amplitude parameters and a set λ of phase-evolution parameters (including frequency, spin-down and sky position). In a semicoherent search, different A are allowed in each segment; but we simplify our notation by redefining A = A . After marginalizing over A and the associated prior (cf. [13,31,40,44]), the posterior probability is Here, o S/G (I) ≡ P (H S |I) /P (H G |I) are the prior odds between a signal and Gaussian noise; is a free parameter (the result of an arbitrary A-prior cutoff); and the semicoherent multi-detector F-statistic is, for a single parameter-space point λ, given by the sum over single-segment coherent F -statistics: In practice, often an interpolating StackSlide algorithm is used, where F(x; λ) for each λ is computed from a set of F (x ; λ ) with the λ picked from a coarser grid in parameter space than the λ. [8,9,11,12]. In Eq. (4), as well as for the rest of the paper, we do not explicitly show the λ-dependence of our detection statistics. These posterior probabilities can be used to compute odds ratios between the different hypotheses. First, we see from Eqs. (1) and (4) that i.e., this Bayesian approach reproduces the F-statistic as the Neyman-Pearson-optimal detection statistic for CW signals in pure Gaussian noise and under the assumed priors. The free parameter F (0) * is irrelevant in this case.

B. Permanence veto
The permanence veto, as introduced in Refs. [24][25][26], works by the following algorithm: From a fixed Gaussian false-alarm level or some real-data noise studies, a threshold F thr is set on the average semicoherent statistic F ≡ F/N seg . Then, for each candidate the highest single-segment contribution is removed, defining where m is the segment with the highest multi-detector F m ≡ max F .
In the original implementation of Refs. [24][25][26], the F pv value of each candidate is compared with the threshold F thr to determine whether to veto the candidate. In our tests in Sec. V, we slightly modify this algorithm to treat the permanence veto on a more equal footing with the other detection statistics: We define F pv exactly as in Eq. (7), but we set a detection threshold by computing the maximum of F pv over a pure-noise data set.

C. Line-robust statistics
Paper I introduced a more general noise model including a simple noncoincident 'line' hypothesis H X L : x X (t) = n X (t) + h X (t; A X ), which just assumes a CW-like disturbance in an arbitrary single detector X. It leads to a line-robust detection statistic which is reproduced here with slightly updated notation.
Marginalisation as for Eq. (4) yields with the per-detector line-prior odds and their sum, We suppress the I-dependence of any odds ratios or Bayes factors in Eq. (8) and from now on. Furthermore, we can combine the (mutually exclusive) hypotheses H G and H L into an extended noise hypothesis H GL ≡ ( H G or H L ), with posterior probability Finally, using Eqs. (4) and (10), we obtain generalized signal-versus-noise odds and, with the conditional probabilities for lines in the absence of a signal, the corresponding Bayes factor, or line-robust statistic, is . (13) In this statistic, the parameter F (0) * determines a transition scale between increased strictness to either Gaussian noise or lines. It can therefore be considered as a tuning parameter for the line-robust statistic. In section VI.B of Paper I it was suggested to choose the lowest F (0) * that makes B S/GL as efficient as F for simulated CW signals in quiet (almost-Gaussian) data, and demonstrated that this tuning choice at the same time offers improved robustness against lines.
The limit of F (0) * → −∞ corresponds to a binary test of H S against H L , excluding Gaussian noise. We refer to this Bayes factor B S/L as the pure line-veto statistic.

III. DERIVING A CW DETECTION STATISTIC THAT IS ROBUST TO SINGLE-SEGMENT DISTURBANCES
Going beyond the noise model of Paper I, we now turn to the issue of noncoincident transient linelike disturbances. To address it in the same Bayesian framework as above, consider a new 'transient-line' hypothesis H X tL for a quasiharmonic disturbance in a single segment and single detector X: This is just the full CW hypothesis from Eq. (3) restricted to a subset x X (t) of the data. Thus, in analogy with Eqs. (4) and (8) and dropping the time-series arguments again, the posterior probability for H X tL is In principle, we could now build up a wide range of composite hypotheses about the whole data-set x, spanning N seg × N det subsets x X (t), by combining instances of H X tL and of the single-segment Gaussian-noise hypothesis H X G , and by setting appropriate constraints on the amplitude parameters {A X }.
For example, the hypothesis H L for persistent singledetector lines corresponds to H X tL with the same A Y for all , but only for a specific detector X = Y; combined with H X G for all other detectors X = Y. However, we concentrate on one specific new full-dataset hypothesis H tL : for the case of a transient, singledetector disturbance in only one and one X, with no prior constraint on the values of these indices. For example, if we have data in two segments for two detectors, the full hypothesis is The full semicoherent posterior probability for this hy-pothesis is then introducing the shorthand notation We can then produce a combined noise hypothesis H GLtL that allows for either pure Gaussian noise, a persistent line or a single-segment transient line: As seen before in Paper I, H X L (A X ) has the same likelihood as H X G in the special case of vanishing amplitude parameters, A X = 0. But when we obtain the full line hypothesis H X L by marginalizing over A X , this is only a null-set contribution; furthermore, the two hypotheses are still, by construction, logically exclusive. The same reasoning applies to H X tL . Hence, the probabilities of these three hypotheses must simply add up: Then, the odds ratio between the classical persistent-CW signal hypothesis H S and the combined triple-noise hypothesis H GLtL yields a new detection statistic where, just as a reminder, the semicoherent F-statistics With the total prior disturbance odds tL/G , we introduce the following shorthands for prior probabilities conditional on the composite noise hypothesis H GLtL , generalizing the p L and p X L from Eq. (12): This allows us to write the corresponding Bayes factor as We see that the difference between (i) the persistentline term already present in the B S/GL of Ref. (13) and (ii) the newly introduced transient-line term is that we have either (i) a sum over X of the exponentials of a sum over of F X , or (ii) a double sum over X and of the exponentials of each individual F X plus a large constant term (N seg − 1) F (0) * . Hence, if there is a strong disturbance in a single (X, ) combination and if the transition-scale parameter F (0) * has been chosen as higher than the typical F X in pure Gaussian noise (in accordance with the tuning procedure described in Sec. VIB of Paper I), then the lat-ter term can dominate in the denominator. This will make B S/GLtL stricter in suppressing these transient disturbances than B S/GL . We could have introduced an additional free tuning parameter into B S/GLtL by using a different cutoff on the A X prior in H X tL than for the A X in H X L , resulting in a different F (0) * appearing. However, we already have freedom in the relative weights of persistent and transientline contributions through the p X L and p X tL , and there is no clear physical motivation in such a complication of the amplitude priors (which were chosen ad hoc, to reproduce the F-statistic, in the first place, cf. Refs. [31,40]).
Hence, we refrain from this possibility, and use the tests in Sec. V to demonstrate sufficient flexibility of B S/GLtL without it.
As the denominator of B S/GLtL is a sum of exponentials (or weighted exponentials, but of course the log of the weights can be absorbed into the exponents), it is often dominated by a single term. The same is true for B S/GL , and its limiting behavior in various cases was discussed in Sec. IVB1 of Paper I. Here, we just give an expression for ln B S/GLtL written as a sum of the dominant term and a logarithmic correction, where D max ≡ max D is the maximum of the set of exponents, with 1 + N det (1 + N seg ) elements: In computer implementations, this form is useful both for numerical stability (avoiding underflows) and to speed up computation when the correction term can be ne- We also consider an intermediate step where we reduce the X -sum in the denominator to the highest persegment contributions from each detector, but keep the remaining 1 + 2N det terms. This will reduce computational cost while also corresponding to the initial assumption of a single-segment disturbance: again, because of the exponentials, a single significantly increased F X will easily dominate over all others. Hence, in many cases a good approximation to the Bayes factor is given by In some applications, purely for reasons of search code simplification and reduction of data volume, only reduced single-segment information may be available: the set of values { F m , { F Xm }} only for the segment m with the highest multi-detector F m ≡ max F . To still obtain an approximate version of B S/GLtL in such cases, we define a modified 'loudest-only' detection statistic This quantity could, in principle, differ quite significantly from the actual Bayes factor B S/GLtL . There is also no guarantee that it is as efficient a detection statistic under our initial hypotheses, so we will test its efficiency with simulated data in Sec. V.

IV. DERIVING A DETECTION STATISTIC FOR PERSISTENT OR TRANSIENT SIGNALS, ROBUST TO PERSISTENT OR TRANSIENT SINGLE-DETECTOR LINES
CW-like transient signals might be interesting search targets. [31,32,38] One might now anticipate that the transient-line-robust Bayes factor B S/GLtL from Eq. (22) is too restrictive towards these, as a multi-detectorcoherent signal in a single segment can increase the denominator of Eq. (22) more than the numerator.
However, the approach of considering more general hypotheses built up from the set { F , { F X }} should actually allow for more sensitivity towards transient signals than any detection statistic based only on the total semicoherent results, like F and O S/GL .
So we try to improve over B S/GLtL by deriving another generalized detection statistic, answering the following question: how likely is any type of CW-like signal (persistent or transient), in comparison with Gaussian noise, a persistent line, or a transient line?
Starting from the full set of single-segment { F , { F X }}, the most general answer would involve a large set of hypotheses for signals in different numbers of segments. But here we keep to the simplifying assumption of single-segment transients, introducing a transient-signal hypothesis as the multi-detector version of Eq. (14): Note that this is different from the single-segment, singledetector transient-line hypothesis H X tL from Eq. (14) only if the data set for segment contains data for at least two detectors X. In this section, we assume this to be the case for the whole data set. However, in the real world the components of a multi-detector network often have different duty factors and standard data selection methods [45] can result in segments with data from one detector only, or with negligible amounts of data from the other detectors.
We test the robustness of this detection statistic, derived with the assumption of full segment coverage by all detectors, by considering a data set with realistic duty factors in Sec. V, and discuss ways to deal with the slight issues it can cause in Sec. V C.
Let us continue from the posterior distribution for H tS , which is analogous to Eq. (15): The hypothesis H tS for a transient signal in an arbitrary segment is the logical OR combination of H tS analogous to Eq. (16), so that the posterior P H tS x, I is obtained in analogy with Eq. (17): Testing for tCW signals only, this yields an odds ratio Just as for the various noise hypotheses, we can also add up the probabilities for the signal hypotheses H S and H tS to evaluate a more general persistent-or-transient 'CW-like' hypothesis: The odds ratio between generalized signal hypothesis and generalized noise hypothesis is then The corresponding generalized Bayes factor follows by introducing additional prior-weight variables in analogy to p X L , p X tL from Eq. (21): for persistent signals and for transient signals.
This persistent-or-transient 'CW-like' robust detection statistic is then given by As was the case for B S/GLtL from Eq. (22), additional freedom in tuning this statistic could be obtained from different amplitude-prior cutoffs in H L , H tL and now also H S and H tS . But again we restrict ourselves to using the same cutoff, resulting in a single tuning parameter F (0) * , and use only the set of prior variables { p S , p tS , p LtL , p X tL } as weights for the various contributions.
Next, we consider the logarithm of this Bayes factor, splitting numerator and denominator separately into sums of a dominant term and a logarithmic correction, which generalizes Eq. (23): where D max is the maximum of the same set of denominator exponents given in Eq. (24) and E max = max E is the maximum of the numerator exponents: For transient signals and disturbances that are indeed limited to a single segment (or reasonably close), it should suffice to compute an approximate Bayes factor using only the maximum single-segment contributions: where m is the segment number with the largest multidetector contribution, so that p m tS e F m ≡ max p tS e F , and m(X) is the analogous segment number for each de- As in Eq. (26), we also define an ad hoc modified 'loudest-only' detection statistic where we use only information from one segment m with the highest multidetector F m ≡ max F : Again this requires empirical tests to verify that it is close in efficiency to the full Bayes factor, which will be demonstrated in Sec. V.
Alternatively, in a search for tCWs only, or for CWs and tCWs with two separate toplists, one could use the Bayes factor corresponding to Eq. (30): All these expressions also simplify significantly if all o tS/G = o S/G and o X tL/G = o X L/G , which we assume for most of the test cases in the next section.

V. TESTS ON SIMULATED DATA
In this section, we present some tests of the new Bayes factors B S/GLtL and B StS/GLtL in the form of injection studies on simulated data, where simulated CW and tCW signals ('injections') are recovered from simulated noise. We use the same basic injection procedure and detection criteria as described in Sec. VIIB of Paper I.

A. Search setup and data sets
For two reasons, it is important to test these detection statistics with realistic data and a search setup that is close to what is used in practice: First, the approach in this paper is to provide a simple extension of the established search codes that already produce the F-statistic and line-robust statistics, which should be directly applicable in current search efforts, and hence tested in similar circumstances. Second, as we are interested in transient features, the time-domain characteristics of real data sets are important for any performance demonstration, especially the occurrence of gaps in the data: it is necessary to test that gaps do not lead to persistent CW signals being rejected, or to a smaller improvement in sensitivity towards tCW signals than in perfectly continuous data.
Hence, we use fully simulated data, but with realistic duty factors taken from the real LIGO S6 data. One data set contains pure Gaussian noise, whereas an additional transient non-Gaussian disturbance is present in the second data set.

Search setup
Our search setup mimics the Einstein@Home [46] 'S6Bucket' search [47] on LIGO S6 data: we use data spanning about 255 d, analyzed semicoherently with N seg = 90 segments of T seg = 60 h.
The analysis is performed with the HierarchSearchGCT code [48], a semicoherent Stack-Slide implementation based on the GCT method of Ref. [11]. We use the same search grids as the S6Bucket search, covering the whole sky and only the first-order spin-down parameterḟ . HierarchSearchGCT is limited to semicoherent refinement in spindown only (by a factor γ r ) but not over the sky, a limitation that has been identified as an important point for future improvement. [49,50] The search output is a toplist of the most significant candidates ranked by one of the semicoherent statistics F or B S/GL . For this study, we have modified the code to also return the single-segment F -and F X -statistics for each toplist candidate.
We first analyze a 50 mHz band of each simulated noise-only data set (purely Gaussian and Gaussian + transient disturbance), and obtain the maximum of each detection statistic over the whole sky and f ,ḟ range.
Then, for a set of fixed signal strengths h 0 , CW or tCW signals with otherwise random parameters are injected into the same noise realization, and searched for again over a smaller search box. This is a subset of the original search grid containing (but usually not centered on) the injection point. A signal is considered as detected if the highest value from this search box exceeds the maximum value from the pure-noise search.
The search parameters for both the full-band noiseonly search and for the smaller injection search boxes are given in Table I. In all test cases, 1000 signals are injected per h 0 value, with a range chosen so that detectionefficiency curves are well-sampled over the whole range from 0 to 1. The signals are drawn with random amplitude parameters cos ι, φ 0 , Ψ; and with f ,ḟ and sky position randomly distributed over the full search range as given in Table I. The distribution of tCW-specific timedomain parameters is discussed below in Secs. V C-V D.
Another point where we construct our procedure in analogy with the S6Bucket search is the ranking of candidates in the toplists kept by the HierarchSearchGCT code. For each search job (51 sky partitions per noiseonly search, or one search box per injection) we keep  two toplists with 1000 candidates each. One toplist is sorted by F and one by the pure line-veto statistic B S/L ( o X L/G = 0.5), which corresponds to B S/GL in the limit of F (0) * → −∞. All other detection statistics are then computed from the union of these two toplists.
In principle, this procedure could lead to some noise outliers or some injections being missed for the 'recomputed' statistics. However, the two toplists (classic Fstatistic and pure line-veto statistic) are very 'orthogonal' in the sense that one is nearly optimal for Gaussian data and one is tuned towards strong disturbances, so that candidates that would be significant by one of the other Bayes factors are very likely to appear in at least one of these two toplists. Also, tests with longer toplists have found that this approach is generally sufficient to not lose any would-be high-significance candidates of any recomputed statistic by having them below the threshold of both ranking statistics.

Simulated data sets
To generate our data, we used the duty factors of the H1 and L1 detectors for the data selection of the Ein-stein@Home S6Bucket search on LIGO S6 data: this gives us 6156 Short Fourier Transforms (SFTs) in H1 and 5924 SFTs in L1, each SFT 1800 s long, with realistic gaps in between.
The data selection method [45] used to generate the S6Bucket segment list was optimized for total sensitivity and did not ensure uniform duty factors over segments and detectors. Hence, it happens to have two particularly unequal segments, where one detector contributes no or very little data (compared to an average of 67 SFTs per segment and detectors): segment 64 (of 90) has no data from detector H1, and segment 76 has only four SFTs from detector L1.
The first 'quiet' data set is pure simulated Gaussian noise, from the Makefakedata v5 code [48], with the sensitivity of the two detectors being realistically slightly unequal: The per-detector normalized SFT power for this data set is shown in Fig. 1, both as a frequencydependent average P X SFT (f ) over the whole data set and in the form of a single-segment maximum max f P X SFT over SFT frequency bins, as a function of segments . The apparent outlier max f P L1 =76 SFT ≈ 3.9 is just an effect of low-number statistics, as segment 76 contains only four SFTs from detector L1. We have also generated a second data set containing a transient single-detector disturbance. We started with an independent realization of Gaussian noise with the same time stamps and PSDs as the first set, and then used the otherwise equivalent implementation Makefakedata v4 [48] 3 to inject a stationary line feature with fixed amplitude h 0L = 4 × 10 −23 and frequency f L = 50.025 Hz in a single detector (H1) during a single segment L = 10. A transient line in a single segment is chosen because, as discussed in the introduction, most strong disturbances in LIGO S5 and S6 data are indeed either persistent over the whole observation time, or over only a single segment. [25,30] The normalized SFT power for this data set is shown in Fig. 2. We see that the disturbance produces a very high single-segment max f P H1 =10 SFT ≈ 15. It is also strong enough to show up in the average P X SFT (f ) over the whole data set, but in this average it is much weaker than the persistent lines studied before (cf. Fig. 7   'pizza-slice disturbances' [30] due to their shape in threedimensional plots of F-statistics against frequency f and spin-downḟ . Fig. 3 presents such a plot for our simulated data set. Though a sharp line in P X SFT , the semicoherent search sees this transient disturbance as a wide structure in parameter space. Different templates match the disturbance at different times, leading to the 'pizza-slice' shape. The simulation result is somewhat narrower than the typical LIGO S6 'pizza slice', since its duration is a whole segment of T seg = 60h, while the corresponding disturbances in S6 data typically last only for a few SFTs. We have also generated a third data set with the same procedure as the second, but with the single-detector disturbance active over the whole observation time, i.e. as a persistent line. In such a case, the new transientoptimized Bayes factors B S/GLtL and B StS/GLtL cannot be expected to yield further improvements over the detection efficiency of the persistent-line-robust statistic B S/GL . Still, we have verified that in this case there are no losses either compared to B S/GL , with both new Bayes factors reproducing the performance found for B S/GL in Paper I and improving over the standard F-statistic. To avoid redundancy with that paper and the purely Gaussian case (data set 1), this set of results is not shown and discussed in detail here, our focus being instead on the cases where improvements can be made.  Table I, as a function of frequency f and spin-downḟ .

Tuning the free parameters of the line-robust statistics
A global value for the transition-scale parameter F (0) * is determined through requiring safety in quiet data, choosing the minimum value required to have negligible differences in detection probability to the F-statistic.
This statement holds down to the false-alarm level probed by this study, which is bounded by the inverse number of fine-grid templates N templ = γ r N sky ∆f δf ∆ḟ δḟ ≈ 2.3 × 10 11 in the search setup, but is effectively somewhat higher due to template overlap.
For the original B S/GL , we re-use a value of F (0) * ≈ 3.027 found in more extensive studies on LIGO S6 data [47]. The present injection study on the pure Gaussian-noise data set is sampled in steps of 0.1 in F (0) * , which for B S/GLtL and B StS/GLtL leads to a value of F (0) * ≈ 3.0. The difference is negligible with respect to the sampling accuracy of 1000 injections per h 0 value, as shown by the results in the next subsection.
For the per-detector line priors, we do not take into account our privileged knowledge from generating the data sets, instead testing the robustness of the detection statistics by a simple choice of o X L/G = o X tL/G = 0.001 for all X and in both data sets. This corresponds to the lower truncation suggested in section VI.A of Paper I as a conservative choice that considers lines as rare, but still keeps the line hypothesis open in case it is strongly preferred by the data.
However, we also investigate the effect of setting o X =64,76 tL/G = 0.0 in the two segments with no or small contributions from one of the two detectors. The rationale for this modification is that the single-segment signal hypothesis H tS of Eq. (27) becomes indistinguishable from our transient-line hypothesis H X tL of Eq. (14) when that segment is completely dominated by a single detector.
For any future searches of LIGO data using these statistics, tuning of both the transition scale F (0) * and the per-detector line-priors will be revisited using the specific search setup and data characteristics.

B. Persistent CW signals
For persistent CW signals, the injection procedure is identical to that in Paper I. Fig. 4 shows results in the form of detection probabilities p det for the various statistics as functions of the scaled signal amplitude h 0 / √ S. As discussed in the previous subsection, tuning F (0) * = 3 allows both B S/GLtL and B StS/GLtL to match almost perfectly the detection efficiency of the F-statistic and of B S/GL in quiet Gaussian data, with maximum discrepancies in p det of 1% (down to the false-alarm level of this search setup). These are smaller than the statistical uncertainties from 1000 injections, and could be resolved with a more detailed F In both cases, using the simplified 'loudest-only' detection statistics from Eqs. (26) and (39)  Also, we see that the performance of the permanence veto [24][25][26] in the absence of tCW signals is closely reproduced by our new Bayes factors.

C. tCW signals of exactly one segment length
For the first set of transient signal injections, we simulate CW-like signals that are active during exactly one segment, i.e. with fixed T inj = T seg = 60h and a start time corresponding to that of a randomly picked segment for each injection. Though not realistic, this configuration is useful as a first test of principle, where the assumptions made in the derivation of Sec. IV correspond exactly to the data, before generalizing the test to a more realistic signal population with varying transient durations in the next section. Detection probabilities for this case are shown in Fig. 5, over both noise data sets (purely Gaussian and Gaussian + transient disturbance).
The established semicoherent detection statistics F and B S/GL achieve h 90% 0 / √ S ≈ 0.1 in the first, quiet data set. This is about a factor 4-5 worse than for persistent signals, which is actually already a smaller ratio than expected from the naive T obs Tinj = N seg scaling for a fully coherent search, but consistent with a more detailed StackSlide sensitivity estimation [51].
When going from the purely Gaussian to the transientline data set, the performance of F and B S/GL decreases somewhat more strongly for these tCW signals than it did for persistent signals, with B S/GL losing up to 10% in p det Considering the permanence veto, we confirm that it would effectively remove almost all of these tCW signals, and hence we indeed need an alternative detection statistic for this case.
The Bayes factor B S/GLtL , which adds to B S/GL only the possibility of transient single-detector disturbances (such as that in the second data set), but not of the multidetector-coherent transient signals we are now injecting, was found before to be safe for persistent CW signals. Now it turns out to be much safer for tCWs than the permanence veto, but still performs worse than B S/GL in both noise data sets, with h 90% 0 / √ S ≈ 0.17. Hence, this is not a particularly safe detection statistic for tCWs.
On the other hand, the full transient-signal-aware B StS/GLtL yields a significant increase in detection efficiency over B S/GL , even in the second data set where a transient single-detector disturbance and transient signals are present together. It achieves h 90% 0 / √ S ≈ 0.08 in both data sets and yields up to 35% improvement in p det for weak signals below this threshold. This is also consistent with the expectations for a StackSlide search when taking into account the additional mismatch accrued by semicoherent statistics. [50,51] Again, there are no losses with the simplified 'loudestonly' detection statistic B StS/GLtL,lo only using the segment m with F m = max F (not plotted separately).
However, a minor problem with B StS/GLtL is easy to overlook in Fig. 5. Even at very high h 0 , where other detection statistics eventually reach p det = 1, it misses a few signal injections, typically about 1%-2%.
We found that all missed injections are related to the previously-mentioned peculiarities of data selection, falling into segments 64 or 76, where one of the detectors contributes no or very little data.
Here, the single-segment hypotheses H X tL and H tS become indistinguishable, and the normalization of B StS/GLtL with the given tuning values is such that it will veto any strong outlier from these segments.
This issue is not a fundamental problem with our approach, as the data selection for future semicoherent searches can easily be constrained to avoid such anomalous segments, making the search better suited for tCW detection without risking efficiency for persistent CWs.
As a simple work-around for the given data selection, we can simply set o X =64,76 tL/G = 0.0 while keeping all other o X tL/G at equal values. This makes p det ( B StS/GLtL ) go to 1 for high h 0 , just as B S/GL does, and sacrifices only 1-2% of p det at lower h 0 , and a similar small amount in the persistent-CW case -which could also be recovered by slightly changing the F (0) * tuning.

D. tCW signals with varying duration
The pragmatic signal model for transient CW-like signals from Eq. (27) explicitly assumes a signal lining up with a single segment, as tested in the previous section. As such an alignment is not very likely in nature, it is interesting to test the robustness of the new detection statistic against deviations from this assumption. Hence, we have also tested injecting transient signals with random lengths T inj and with random start times uniformly drawn from [t start , t end − T inj ].
For better comparison with Fig. 5, the strength of these signals is scaled according to h 0 ∝ T seg /T inj , so that the average signal-to-noise ratios (SNRs) for each nominal h 0 value are the same. (But note that the per-injection SNRs are not fixed, as they still depend on the three randomized amplitude parameters.) As an example, we show the results for the Gaussiannoise data set, and for T inj uniformly drawn from the interval [0.5, 2.0] × T seg = [30,120]h, in Fig. 6 B StS/GLtL achieving h 90% 0 / √ S ≈ 0.1 instead of ≈ 0.08. This is mostly due to the fact that now a significant fraction of injections falls completely or partially within gaps of the simulated data set, or within parts with very low duty factor, thus decreasing the effective SNR for any detection method.
The main finding here is that the transient-aware Bayes factor B StS/GLtL still improves over the other statistics, and that this is still true even for the approximate 'loudest-only' version. This indicates that, though the initial assumption of a tCW signal that exactly matches the duration of a single segment seemed quite strict and arbitrary, this simple approach is in fact useful for a wider range of tCW durations.
We also observe that the permanence veto is not quite as strict in falsely vetoing these tCW signals as it was for T inj = T seg , as some fraction of them that overlaps with more than one segment can now still contribute to the reaveraged detection statistic. Still, it is not competitive with any of the other tested detection statistics, which is no surprise, since it was not constructed to accept transient signals in the first place.

VI. CONCLUSIONS
In this paper, we have considered F-statistic-based semicoherent searches for CWs on data that also contain transient instrumental disturbances or signals that are transient, but also CW-like (quasimonochromatic). We have generalized the Bayesian model-selection approach of Refs. [13,31,40] with explicit models for transients lasting for a single segment in a semicoherent search, including single-detector disturbances and multi-detectorcoherent signals, and demonstrated that the resulting statistic can be effective even for transients of different durations.
For this demonstration, we injected simulated CW and tCW signals into several simulated data sets, using realistic duty factors corresponding to the two LIGO detectors during their sixth science run. We have shown that the new detection statistic B StS/GLtL is more robust than standard semicoherent statistics towards both persistent and transient single-detector disturbances in the data, while not hurting sensitivity to persistent CW signals, and that it is more sensitive towards transient signals.
We found that B StS/GLtL works best if the transient signals or disturbances indeed last for exactly a single segment of the semicoherent search. But it still yields significant improvement over standard methods for transient durations shorter or longer than one segment length.
Though the injection studies showed a minor issue with B StS/GLtL dismissing a small number of strong tCW signals, this was found to be related solely to a peculiarity of the data selection used in our tests. It can be worked around by prior tuning, while for future combined CW-tCW searches the issue can easily be avoided by a properly constrained data selection.
Just as with the line-robust statistic B S/GL of Paper I, the new detection statistic B StS/GLtL only requires quantities that are already computed in any semicoherent F-statistic search: namely the single-detector and single-segment F-statistics. Hence, computational cost is only increased by the arithmetic operations in computing B StS/GLtL , as given in Eq. (23). Our injection studies showed that this is usually dominated by a few terms, and that good sensitivity can already be obtained by computing B StS/GLtL only for the most significant candidates obtained from other statistics. Hence, these results allow for a CW search with increased robustness to transient disturbances and increased sensitivity to transient signals as a computationally cheap 'add-on' to existing searches, such as the Einstein@Home project [46].
The present approach could be further generalized to allow for an explicit classification of periodic data signatures into several classes (persistent CW signals, persistent lines, transient disturbances, and 'transient-CW' signals), with transient lengths of any multiple of a segment length, through the Bayesian Blocks algorithm [52,53].
Multi-detector transient disturbances cannot be safely distinguished from transient astrophysical signals by con-sidering the per-segment and per-detector F-statistics only. However, for widely separated detectors these are much rarer than single-detector disturbances, and hence it should be possible to investigate any coincident transient candidates with more detailed analysis of their frequency evolution and coherence with auxiliary channels.
As this work shows how to increase tCW sensitivity by simple modifications to existing CW searches, other more dedicated search methods might be more powerful, but not without significant computational effort, so that the present results will find practical applications regardless. Still, sensitivity comparisons of tCW detection methods between this work, the dedicated tCW detection statistic of Ref. [31] and the more generic 'long-transient' excesspower method of Ref. [23] would be of great interest for the development of optimal overall search strategies.
Such a comparison will, however, require significant further work, expertise from different sub-fields of GW data analysis, and great care in ensuring a comprehensive and fair evaluation of each approach under equal circumstances. Hence, it would be an interesting opportunity for a community mock-data challenge modelled after a recent study [54] of methods to detect CW signals from the binary source Sco-X1, which also compared CW-optimized and generic search methods.
We then build up sketches of the full semicoherent hypothesis by arranging the two detectors on the horizontal axis and the two segments on the vertical axis.
This way, the signal-vs-Gaussian Bayes factor from Eq. (6), which is equivalent to the F-statistic [40], can be represented (up to proportionality, corresponding to global priors) as Using the same sketch notation, the pure line-veto statistic from Paper I reads as and the more general line-robust statistic, reproduced here in Eq. (13), is (A3) In this paper, we have generalized the approach of Paper I to yield (i) a detection statistic that takes into account transient lines in any single-detector, single-segment subset as an additional noise component in the denominator, given in Eq. (22), and that we can sketch as