arXiv:0901.2573v1 [astro-ph.IM] 16 Jan 2009 illn ains(97 n ri ta.(99 (equiva- (1989) al. a by to et sums generalisation Irwin weighted the and to introducing (1987) lent by Baliunas & solved in Gilliland was errors measurement This the take account. not does periodogram Scargle hr h asaeue nti ae osmoieteclassic the symbolise to paper ˆ this parameter in The used expressions. are hats the where crl eidga sdfie s(omlsto rmLomb from (normalisation as defined 1976): is periodogram Scargle qiaett tigsn ae fteform the of waves serie sine time fitting of to analysis equivalent frequency and use searches widely period a in is tool 1982) (Scargle periodogram Lomb-Scargle The Introduction 1. o iesre ( series time of a detection beha the For of statistical significance its statistical the investigated especially Scargle furthermore and (1976) who Lomb also (1982), and (1963), Barning by given was ehdpoie naayi ouinadi hrfr ohc e both and therefore use is to and solution venient Lomb-Scar analytic the an frequency, provides sampled s method each a of for solution equations the linear require procedures fitting standard While aur 0 2009 20, January srnm Astrophysics & Astronomy p ˆ ( oee,teeaetosotoig.Frt h Lomb- the First, shortcomings. two are there However, ω ) Received e-mail: 691 K¨onigstuhl 17, f¨ur Astronomie, Max-Planck-Institut h obSageproormi omnto ntefrequen the in tool common a is periodogram Lomb-Scargle The fsn ae.W iea nltcslto o h generalis the for solution analytic an give We waves. sine of oprdt h obSageproorm h generalisat the periodogram, Lomb-Scargle the to Compared iSe rga,frwihw on u oeeuvlne.F equivalences. some out point we which for float program, SigSpec the transform, Fourier discrete date-compensated the oaisn,adgvsamc etrdtriaino h spe the e of computational determination better the much and a gives and aliasing, to o h vlaino h elra eidga htsearch that periodogram Keplerian the of evaluation the for eaueu oli erhsfrteobtlproso exopla of periods words. orbital Key the for searches detec in of tool capable useful is a algorithm be non-random and systematic The = = P YY e omls o h otn-enadKpeinperiodog Keplerian and floating- the for formalism new A 1 ˆ 1 i [email protected] y        i 2 / CC YC        Accepted ˆ ˆ P ehd:dt nlss–mtos nltcl–mtos sta methods: – analytical methods: – analysis data methods: τ 2 τ ˆ ˆ P t + i i a 2 tan , ffi y i cos i y h eeaie obSageperiodogram Lomb-Scargle generalised The S S YS in.Teeuto o h periodogram the for equation The cient. cos i ˆ ˆ ihzr en( mean zero with ) ω 2 τ 2 τ ˆ ˆ τ ω ω        ˆ ff τ ( r ssmlr u prahbig oehrsvrlrelate several together brings approach Our similar. is ort ( = aucitn.GLSperiodogram no. manuscript t t scluae via calculated is i i χ P − − P 2 i τ i τ ˆ ˆ o 2 cos t.Scn,frteanalysis the for Second, fit). i 2 sin ) )  2 + ω ω P t t i i y P . i y = y i sin i a = sin .Zechmeister M. cos 2 ) h Lomb- the 0), ω ω ω ( ( t t i i t + − − signal. a b 7Hiebr,Germany Heidelberg, 17 τ τ ˆ ˆ n-enproorm n h seta infiac”esti significance” “spectral the and periodogram, ing-mean sin ) ) .I is It s. viour,  nets. sfrtepro ftebs-tigKpeinobtt radia to orbit Keplerian best-fitting the of period the for es tof et 2 ABSTRACT ta nest.Ol e oictosaerqie o th for required are modifications few a Only intensity. ctral o sspro si rvdsmr cuaefeunis is frequencies, accurate more provides it as superior is ion to oafl iewv t nldn no an including fit, wave sine full a to ation on- ω        gle (3) (1) (2) rhroe epeeta loih htipeet hsge this implements that algorithm an present we urthermore, igecnrcobt,wihi eosrtdb w example two by demonstrated is which orbits, eccentric ting to al t d yaayi fueulysae aaeuvln oleast-sq to equivalent data spaced unequally of analysis cy . 1 n .K¨urster M. and ae n a vroeti supinwt h introductio the the are the with o function sine assumption that an fitted this of assumes the overcome of which can mean One subtracted, the same. and was data data the of the mean of mean the dga oteeuvln fwihe ulsn aefitting; wave sine full y weighted of equivalent the to odogram epee oaotantto lsl eae oteLomb- ˆ b the parameter approach the an to generalise such not for related did tries (2001) closely Shrager (GLS). notation Lomb-Scarg riodogram generalised the a it calling adopt periodogram Scargle to prefer (DCD transform We Fourier ca discrete (1981), date-compensated Ferraz-Mello this by ing given been already have spectrum comp the for periodogram. solution this statis analytical of an sophisticated tion use a not also do but and treatment, t definition comparable formal observations.” periods the a of for provided duration or the uneven, than observation greater is or of sampling number the the sampled small, a when is non-robust of it mean the making in nusoid, fluctuations statistical for account superior: is th approach argue periodogram”, “floating-mean generalisation this dga a eotie nasrihfradmne nthe in manner straightforward a per in Lomb-Scargle obtained generalised be the can for odogram solution analytic The periodogram Lomb-Scargle generalised The 2. 4). (Sect. (2007) Reegen by program SigSpec the e in significance” used “spectral the tor all to also equivalences and out point ones to classical us (Sec the to following symmetry the comparable in a derived have are which equations, eralised = (GLS) aial,aayia omlefrafl ie least-squa sine, full a for formulae analytical Basically, itcl–tcnqe:rda velocities radial techniques: – tistical a cos ff set ω t c + ehd htcnb on nteltrtr,viz. literature, the in found be can that methods d eutn nafrhrgnrlsto fti peri- this of generalisation further a in resulting , b 1 sin ω ..teLm-crl eidga al to fails periodogram Lomb-Scargle the “... t + c umn ta.(99,wocalled who (1999), al. et Cumming . ff τ e n egt ( weights and set nE.() oevr u gen- our Moreover, (3). Eq. in ao sdi the in used mator essusceptible less eoiydata. velocity l rams computation e ae fitting uares neralisation χ n can and s

hs authors These 2 c fitting). S 2009 ESO stima- tthis at epe- le .2), t. FT). tical uta- i.e., ow res si- ll- ut i- o n s 2 M. Zechmeister and M. K¨urster: The generalised Lomb-Scargle periodogram same way as outlined in Lomb (1976). Let yi be the N mea- So the sums YC and YS use the weighted mean subtracted data surements of a at time ti and with errors σi. Fitting a and are calculated in the same way as for the Lomb-Scargle pe- full sine function (i.e. including an offset c): riodogram (but with weights). The generalised Lomb-Scargle periodogram p(ω) in Eq. (4) y(t) = a cos ωt + b sin ωt + c is normalised to unity and therefore in the range of 0 p 1, 2π = ≤ =≤ at given frequency ω (or period P = ω ) to minimise the with p 0 indicating no improvement of the fit and p 1 a 2 2 squared difference between the data yi and the model function “perfect” fit (100% reduction of χ or χ = 0). y(t): As the full sine fit is time-translation invariant, there is N [y y(t )]2 also the possibility to introduce an arbitrary time reference 2 i i 2 2 χ = − = W wi[yi y(ti)] point τ (t t τ; now, e.g. CC = w cos ω(t τ) 2 − i i i i i=1 σi → −2 2 − − X X ( wi cos ω(ti τ)) ), which will not affect the χ of the fit. If where this parameter−τ is chosen as P P 1 1 1 wi = W = wi = 1 2CS W σ2 σ2 tan2ωτ = (19) i  i  CC SS  X X  −  1  wi sin 2ωti 2 wi cos ωti wi sin ωti are the normalised weights . Minimisation leads to a system of = − 2 2 (three) linear equations whose solution is derived in detail in wi cos2ωti ( wi cos ωti) ( wi sin ωti) Appendix A.1. Furthermore, it is shown in A.1 that the relative P − P −P χ2-reduction p(ω) as a function of frequency ω and normalised P h P P i the interaction term in Eq. (5) disappears, CS τ = wi cos ω(ti to unity by χ2 (the χ2 for the weighted mean) can be written as: − 0 τ) sin ω(ti τ) wi cos ω(ti τ) wi sin ω(ti τ) = 0 (proof − − − −P χ2 χ2(ω) in Appendix A.2) and in this case we append the index τ to the ω = 0 − time dependent sums.P The parameterP τ(ω) is determined by the p( ) 2 (4) χ0 times ti and the measurement errors σi for each frequency ω. So 1 when using τ as defined in Eq. (19) the periodogram in Eq. (5) p(ω) = SS YC2 + CC YS 2 2CS YC YS (5) YY D · · − · · becomes · 1 YC2 YS 2 with: h i p(ω) = τ + τ . (20) YY CCτ SS τ D(ω) = CC SS CS 2 (6) " # · − Note that Eq. (20) has the same form as the Lomb-Scargle pe- and the following abbreviations for the sums: riodogram in Eq. (1) with the difference that the errors can be weighted (weights wi in all sums) and that there is an additional Y = wiyi (7) second term in CCτ, SS τ, CS τ and tan2ωτ (Eqs. (13)–(15) and Eq. (19), respectively) which accounts for the floating mean. C = X wi cos ωti (8) The computational effort is similar as for the Lomb-Scargle S = X wi sin ωti (9) periodogram. The incorporation of the offset c requires only two additional sums for each frequency ω (namely S = w sin ωt X i i and C = w cos ωt or S and C respectively). The effort is YY = YYˆ Y Y YYˆ = w y2 (10) i i τ τ − · i i even weaker when using Eq. (5) with keeping CS insteadP of us- ing Eq. (20)P with the parameter τ introduced via Eq. (19) which YC(ω) = YCˆ Y C YCˆ = X wiyi cos ωti (11) − · needs an extra preceding loop in the algorithm. If the errors are YS (ω) = YSˆ Y S YSˆ = X wiyi sin ωti (12) taken into account as weights, also the multiplication with wi − · must be done. CC(ω) = CCˆ C C CCˆ = X w cos2 ωt (13) − · i i For fast computation of the trigonometricsums the algorithm of Press & Rybicki (1989) can be applied, which has advan- SS (ω) = SSˆ S S SSˆ = X w sin2 ωt (14) − · i i tages in the case of large data sets and/or many frequency steps. Another possibility are trigonometric recurrences2 as described CS (ω) = CSˆ C S CSˆ = X wi cos ωti sin ωti (15) − · in Press et al. (1992). Note also that the first sum in SS can be Note that sums with hats correspondX to the classical sums. expressed by SSˆ = 1 CCˆ . 2 − W YY χ0 is simply the weighted sum of squared devia- tions· from≡ the weighted mean. The mixed sums can also be writ- ten as a weighted covariance Covx,y = wi xiyi X Y/W = 3. Normalisation and False-Alarm probability (FAP) E(x y) WE(x)E(y) where E is the expectation− value,· e.g. · − There were several discussions in the literature on how to nor- YS = Covy,sin ωt. P malise the periodogram. For the detailed discussion we refer to With the weighted mean given by y = wiyi = Y Eqs. (10)- (12) can also be written as: the key papers by Scargle (1982), Horne & Baliunas (1986), P Koen (1990) and Cumming et al. (1999). The normalisation be- 2 YY = wi(yi y) (16) comes important for estimations of the false-alarm probability − of a signal by means of an analytic expression. Lomb (1976) YC(ω)= X w (y y)cos ωt (17) 2 i i − i showed that if data are Gaussian noise, the terms YCˆ /CCˆ and 2 YS (ω)= X w (y y) sin ωt . (18) YSˆ /SSˆ in Eq. (1) are χ2-distributed and therefore the sum of i i − i 1 X 2 For clarity the bounds of the summation are suppressed in the fol- E.g. cos ωk+1t = cos(ωk + ∆ω)t = cos ωkt cos ∆ωkt sin ωkt sin ∆ωt lowing notation. They are always the same (i = 1, 2,..., N). where ∆ω is the frequency step. − M. Zechmeister and M. K¨urster: The generalised Lomb-Scargle periodogram 3 both (which is p) is χ2-distributed with two degrees of free- Table 1. Probabilities that a periodogram power (P , p, P or z) can ∝ n dom. This holds for the generalisation in Eq. (20) and also be- exceed a given value (Pn,0, p0, P0 or z0) for different normalizations comes clear from the definition of the periodogram in Eq. (4) (from Cumming et al. 1999). 2 2 χ0 χ (ω) p(ω) = − 2 where for Gaussian noise the difference in the χ0 Reference level Range Probability 2 2 2 numerator χ0 χ (ω) is χ -distributed with ν = (N 1) (N 3) = population Pn [0, ) Prob(Pn > Pn,0) = exp( Pn,0) ∈ ∞ −N 3 − − − − − 2 degrees of freedom. sample variance p [0, 1] Prob(p > p0) = (1 p0) 2 ∈ − N 3 The p(ω) can be compared with a known noise level pn (ex- N 1 2P 2− – ” – P [0, 2− ] Prob(P > P0) = 1 N 1 pected from the a priori known noise variance or population ∈ − − N 3 2z0 − 2− variance) and the normalisation of p(ω) to pn residual variance z [0, ) Prob(z > z0) = 1 + N 3  ∈ ∞ − p(ω)   Pn = (21) Since in period search with the periodogram we study a p n range of frequencies, we are also interested in the significance can be considered as a signal to noise ratio (Scargle 1982). of one peak compared to the peaks at other frequencies rather However, this noise level is often not known. than the significance of a single frequency.The false alarm prob- Alternatively, the noise level may be estimated for Gaussian ability (FAP) for the period search in a frequency range is given noise from Eq. (4) to be p = 2 which leads to: by n N 1 FAP = 1 [1 Prob(z > z )]M (24) − − − 0 N 1 where M is the number of independent frequencies and may be P = − p(ω) (22) estimated as the number of peaks in the periodogram. The width 2 1 of one peak is δ f T ( frequency resolution). So in the fre- and is the analogon to the normalisation in Horne & Baliunas ≈ ≈ ∆ f quency range ∆ f = f2 f1 there are approximately M = (1986)3. So if the data are noise, P = 1 is the expected value. − δ f peaks and in the case f f one can write M T f (Cumming If the data contains a signal, P 1 is expected at the signal 1 2 2 2004). Finally, for low FAP≪ values the following≈ handy approx- frequency. However, this power is≫ restricted to 0 P N 1 . 2− imation for Eq. (24) is valid: But if the data contains a signal or if errors≤ are≤ under- or 2 FAP M Prob(z > z ) for FAP 1. (25) overestimated or if intrinsic variability is present, then pn = N 1 0 − ≈ · ≪ may not be a good uncorrelated estimator for the noise level. Another possibility to access M and the FAP are Monte Cumming et al. (1999) suggested to estimate the noise level a Carlo or bootstrap simulations in order to determine how often a posteriori with the residuals of the best fit and normalised the certain power level (z0) is exceeded just by chance. Such numer- periodogram as ical calculation of the FAP are much more time-consuming than the actual computation of the GLS. N 3 χ2 χ2(ω) N 3 p(ω) z(ω) = − 0 − = − (23) 2 χ2 2 1 p best − best 4. Equivalences between the GLS and SigSpec where the index “best” denotes the corresponding values of the (Reegen 2007) best fit (pbest = p(ωbest)). Reegen (2007) developed a method, called SigSpec, to deter- Statistical fluctuations or a present signal may lead to a larger mine the significanceof a peak at a given frequency(spectral sig- periodogram power. To test for the significance of such a peak in nificance) in a discrete Fourier transformation (DFT) which in- the periodogram the probability is assessed that this power can cludes a zero mean correction. We will recapitulate some points arise purely from noise. Cumming et al. (1999) clarified that the from his paper in an adapted and shortened way in order to show different normalisations result in different probability functions several equivalences and to disentangle different notations used which are summarised in Table 1. Note that the last two proba- by us and used by Reegen (2007). For a detailed description we bility values are the same for the best fit (z0 = zbest): refer to the original paper. Briefly, approachingfrom Fourier the- ory Reegen (2007) defined the zero mean corrected Fourier co- (N 3)/2 (N 3)/2 4 2zbest − − pbest − − efficients Prob(z > zbest) = 1 + = 1 + N 3 1 pbest 1 1 − ! − ! aZM(ω) = yi cos ωti yi cos ωti (N 3)/2 N − N2 · 1 − − (N 3)/2 = = (1 pbest) − 1 X 1 X X 1 p − bZM(ω) = yi sin ωti yi sin ωti − best ! N − N2 · = Prob(p > p ) = Prob(P > P ). best best which obviously correspondX to YC and XYS in Eqs.X (11) and (12). Their are given by Furthermore Baluev (2008) pointed out that the power definition 2 y 2 2 2 2 1 N 2 χ a = cos ωti cos ωti ω = 0 ZM N2 − N Z( ) − ln 2 D E 3 χ (ω) D E "X X  # 3 These authors called it the normalization with the sample variance 2 2 2 as a nonlinear (logarithmic) scale for χ has an exponential dis- σ0. Note that p(ω) is already normalized with χ0. For the unweighted 1 2 N tribution (similiar to Pn) case (wi = N , σ0 = N 1 YY) one can write Eq. (22) with Eq. (20) as 2 2 − P(ω) = 1 N YC + YS . 2 σ2 CC SS 2 (N 3)/2 0 χ (ω) − 4 1 Z Here only the unweighted case is discussed (wi = ). Reegen Prob(Z > Zbest) = e− = = Prob(p > pbest). h i N χ2 (2007) also gives a generalization to weighting.  0      4 M. Zechmeister and M. K¨urster: The generalised Lomb-Scargle periodogram

y2 The two indicators differ only in a normalisation factor, which 2 2 1 2 b = sin ωt sin ωt N 1 2 ZM 2 i i becomes log e, when y is estimated with the sample vari- DN E − N 2− D E "X X  # 2 N The precise value of these variances depends on the temporal ance yi = N 1 YY. Therefore,D E SigSpec gives accurate fre- y2 quencies just like− least squares. But note that the Fourier am- sampling. These variances can be expressed as a2 = CC D E ZM hNi ffi 2 plitude is given by the sum of the squared Fourier coe cient 2 y 2 = 2 + 2 = α2 + β2 2 + 2 = 2 + 2 and bZM = hN iSS . D E A aZM bZM 4 4 YC YS YCτ YS τ while ∼ 2 2 Consider now two independent Gaussian variables whose 2 2 2 YCτ YS τ the least-squares fitting amplitude is A = a + b = 2 + 2 D E CCτ S S τ cumulative distribution function (CDF) is given by: (see A.1). 2 2 ff 1 α + β The comparison with SigSpec o ers another point of view. − 2 α2 β2 Φ(α, β ω) = e !. It shows how the GLS is associated to Fourier theory and how it | h i h i can be derived from the DFT (discrete Fourier transform) when A Gaussian distribution of the physical variable yi in the time demanding certain statistical properties such as simple statistical domain will lead to Gaussian variables aZM and bZM which in behaviour, time-translation invariance (Scargle 1982) and vary- general are correlated. A rotation of Fourier Space by phase θ0 ing zero mean. The shown equivalences allow vice versa to apply

N sin 2ωti 2 cos ωti sin ωti several of Reegen’s (2007) conclusions to the GLS, e.g. that it is tan2θ0 = − less susceptible to aliasing or that the time domain sampling is N cos2ωt ( cos ωt )2 + ( sin ωt )2 P i − P i P i taken into account in the probability distribution. ffi transforms aZM andP bZM into uncorrelatedP coePcients α and β with vanishing covariance. Indeed, ωτ from Eq. (19) and θ0 have the same value, but τ is applied in the time domain, while θ0 is 5. Application of the GLS to the Keplerian applied to the phase θ in the Fourier domain.It is only mentioned periodogram (Keplerian fits to radial velocity here that the resulting coefficients 2α and 2β correspond to YCτ data) and YS τ. Finally, Reegen (2007) defines as the spectral significance The search for the best-fitting sine function is a multidimen- sig(α, β ω) := log Φ(α, β ω) and writes: sional χ2-minimisation problem with four parameters: period P, | − | amplitude A, phase ϕ and offset c (or frequency ω = 2π/P, a, 2 N log e aZM cos θ0 + bZM sin θ0 b and c). At a given frequency ω the best-fitting parameters A, sig(a , b ω) = (26) ZM ZM| y2 α ϕ and c can be computed immediately by an analytic solution  0 !  revealing the global optimum for this three dimensional param-  a cos θ b sin θ 2 + ZM 0 − ZM 0 eter subspace. But involving the frequency leads to a lot of local χ2 β0  optima (minima in ) as visualised by the numbers of max- ! ima in the generalised Lomb-Scargle periodogram. With step-  where  ping through frequency ω one can pick up the global optimum in the four dimensional parameter space. That is how period search α2 α := 2N with the periodogram works. Because an analytic solution (im- 0 y2 s plemented in the GLS) can be employed partially, there is no need for stepping through all parameters to explore the whole 2 2 = 2 ω θ ω θ parameter space for the global optimum. 2 N cos ( ti 0) cos( ti 0) N − − − This concept can be transferred to the Keplerian peri- r   X hX i odogram which can be applied to search stellar radial veloc- β2 ity data for periodic signals caused by orbiting companions and β := 2N 0 y2 measured from spectroscopic Doppler shifts. The radial velocity s curve becomes more non-sinusoidal for a more eccentric orbit 5 2 2 and its shape depends on six orbital elements : = N sin2(ωt θ ) sin(ωt θ ) N2 i − 0 − i − 0 r   γ constant system radial velocity are called normalisedX semi-major andh semi-minorX axes.i Note 2 2 K radial velocity amplitude that α0 2CCτ and β0 2SS τ. Reegen∼ (2007) states∼ that this gives as accurate frequencies ̟ longitude of periastron as do least squares. However, from this derivation it is not clear e eccentricity that this is equivalent. But when comparing Eq. (26) to Eq. (20) T0 periastron passage with using YC = YC cos ωτ+YS sin ωτ and YS = YS cos ωτ τ τ P period. YC sin ωτ: − 1 (YC cos ωτ + YS sin ωτ)2 In comparison to the full sine fit there are two more param- p(ω) = eters to deal with which complicates the period search. An ap- YY CCτ " proach to simplify the Keplerian orbit search is to use the GLS (YS cos ωτ YC sin ωτ)2 + − to look for a periodic signal and use it for an initial guess. But SS τ choosing the best-fitting sine period does not necessarily lead to # the equivalence of the GLS and the spectral significance estima- the best-fitting Keplerian orbit. So for finding the global opti- tor in SigSpec (and with it to least squares) is evident: mum the whole parameter space must be explored. 5 K = 2π a sin i with a the semi-major axis of the stellar orbit and i YY N log e P √1 e2 sig(a , b ω) = · p(ω). − ZM ZM| 2 y2 · the inclination.

M. Zechmeister and M. K¨urster: The generalised Lomb-Scargle periodogram 5

The Keplerian periodogram (Cumming 2004), just like the seems to be similar to ours. But the possibility to use partly an GLS, shows how good a trial period (frequency ω) can model analytic solution or the need for stepping T0 is not mentioned by the observed radial velocity data and can be defined as (χ2- these authors. reduction): The effort to compute the Keplerian periodogram with the 2 2 χ0 χKep(ω) described algorithm is much stronger in comparison to the GLS. pKep(ω) = − . There are three additional loops: two loops for stepping through χ2 0 e and T0 and one for the iteration to solve Kepler’s equation. Instead of the sine function, the function Contrary to the GLS it is not possible to use recurrences or the fast computation of the trigonometric sums mentioned in Sect. 2. RV(t) = γ + K[e cos ̟ + cos(ν(t) + ̟)] (27) However we would like to outline some possibilities for tech- nical improvements for a faster search. The first concerns the which describes the radial reflex motion of a star due to the grid size. We choose a regular grid for e, T0 and ω. While this is gravitational pull of a planet, serves as the model for the ra- adequate for the frequency ω, as we discuss later in this sec- dial velocity curve. The time dependence is given by the true tion, there might be a more appropriate e-T grid, e.g. a less anomaly ν which furthermore depends on three orbital parame- 0 dense grid size for T0 at lower eccentricities. A second possi- ters (ν(t, P, e, T0)). The relation between ν and time t is: bility is to reduce the iterations for solving Kepler’s equation by using the eccentric anomalies (or differentially corrected ones) ν 1 + e E tan = tan as initial values for the next slightly different grid point. This 2 1 e 2 r − can save several ten percent of computation time, in particular in dense grids and at high eccentricities. A third idea which might t T0 E e sin E = M = 2π − (28) have a high potential for speed up is to combine our algorithm P − with other optimisation techniques (e.g. Levenberg-Marquardt where E and M are called eccentric anomaly and mean anomaly, instead of pure stepping) to optimise the remaining parameters respectively6. Eq. (28), called Kepler’s equation, is transcendent in the function pe,T0 (ω). A raw grid would provide the initial val- meaning that for a given time t the eccentric anomaly E cannot ues and the optimisation technique would do the fine adjustment. be calculated explicitly. To give an example Fig. 1 shows RV data for the M 2 For the computation of a Keplerian periodogram χ is to be dwarf GJ 1046 (K¨urster et al. 2008) along with the best-fitting minimised with respect to five parameters at a fixed trial fre- Keplerian orbit (P = 168.8d, e = 0.28). Figure 2 shows the quency ω. Similar to the GLS there is no need for stepping Lomb-Scargle, GLS and Keplerian periodograms. Because a through all parameters. With the substitutions c = γ + Ke cos ̟, Keplerian orbit has more degrees of freedom it always has the a = K cos ̟ and b = K sin ̟ Eq. (27) can be written as: 2 highest χ reduction (0 p p p , < . p 1). − ≤ LS ≤ GLS ≤ Kep e 0 6 ≤ Kep ≤ RV(t) = c + a cos ν(t) + b sin ν(t) As a comparison the Keplerian periodogram restricted to e < 0.6 is also shown in Fig. 2. At intervals where pKep ex- and with respect to the parameters a, b and c the analytic solution ceeds pe<0.6 the contribution is due to very eccentric orbits. Note can be employed as described in Sect. 2 for known ν (instead that the Keplerian periodogram obtains more structure when the of ωt) . So for fixed P, e and T0 the true anomalies νi can be search is extended to more eccentric orbits. Therefore the evalu- calculated and the GLS fromEq. (5) (now using νi instead of ωti) ation of the Keplerian periodogramneeds a higher frequency res- can be applied to compute the maximum χ2-reduction (p(ω)), olution (this effect can also be observed in O’Toole et al. 2009). This is a consequence of the fact that more eccentric orbits are here called pe,T0 (ω). Stepping through e and T0 yields the best Keplerian fit at frequency ω: spikier and thus more sensitive to phase and frequency. Other than O’Toole et al. (2009) we plot the periodograms 7 pKep(ω) = max pe,T0 (ω) against frequency to illustrate that the typical peak width δ f is e,T0 frequency independent. Thus equidistant frequency steps (d f < as visualised in the Keplerian periodogram. Finally, with step- δ f ) yield a uniform sampling of each peak and are the most eco- ping through the frequency, like for the GLS, one will find the nomic way to compute the periodogram rather than e.g. loga- best-fitting Keplerian orbit having the overall maximum power: rithmic period steps (leading to oversampling at long periods: d f = d 1 = 1 dP = 1 d ln P) as used by O’Toole et al. (2009). P − P2 − P pKep(ωbest) = max pKep(ω) Still the periodograms can be plotted against a logarithmic pe- ω riod scale as e.g. sometimes preferred to present a period search There exist a series of tools (or are under development) us- for exoplanets. ing genetic algorithms or Bayesian techniques for fast searches Figure 4 visualises local optima in the pe,T0 map at an arbi- for the best Keplerian fit (Ford & Gregory 2007; Balan & Lahav trary fixed frequency. There are two obvious local optima which 2008). The algorithm, presented in this section, is not further means that searching from only one initial value for T0 may be optimised for speed. But it works well, is easy to implement not sufficient as one could fail to lead the best local optimum in and is robust since in principle it cannot miss a peak if the 3 the e-T0 plane. This justifies a stepping through e and T0. The dimensional grid for e, T0 and ω is sufficiently dense. A reli- complexity in the e-T0 plane, in particular at high eccentricities, able algorithm is needed for the computation of the Keplerian finally translates into the Keplerian periodogram. When vary- periodogram which by definition yields the best fit at fixed fre- ing the frequency the landscape and maxima will evolve and the quency and no local χ2-minima. O’Toole et al. (2007, 2009) de- maxima can also switch. veloped an algorithm called 2DKLS (two dimensional Kepler In the given example LS and GLS would give a good initial Lomb-Scargle) that works on grid of period and eccentricity and guess for the best Keplerian period with only a slight frequency shift. But this is not always the case. 6 The following expressions are also used frequently: sin ν = √1 e2 sin E cos E e 7 1 −e cos E and cos ν = 1 e cos−E . for Fourier transforms this is common − − 6 M. Zechmeister and M. K¨urster: The generalised Lomb-Scargle periodogram

2000 1 0.6 0.9 0.5 1000 0.8 0.7 0.4 0.6 0 0.5 0.3 RV [m/s]

0.4 Power p 0.2 -1000 Eccentricity e 0.3 0.2 0.1 0.1 -2000 0 0 3200 3400 3600 3800 4000 4200 0 90 180 270 360 Barycentric Julian Date BJD - 2 450 000 Periastronpassage T0 [deg]

Fig. 1. The radial velocity (RV) time series of the M dwarf GJ 1046. Fig. 4. Power map (pe,T0 ) for e and T0 at the arbitrary fixed frequency 1 The solid line is the best Keplerian orbit fit (P = 168.8 d, e = 0.28). f = 0.00422 d− . The maximum value p = 0.592 is deposited in the Keplerian periodogram. Note that there are the two local optima. 1 14 pKep i.e. it has a 10 times higher significance. In Fig. 3 the peri- pKep, e<0.6 2 0.8 p odogram power is plotted on a logarithmic scale for χ on the GLS 2 pLS right-hand side. The much lower χ is another convincing argu- 0.6 ment for the much higher significance. Cumming (2004) suggested to estimate the FAP for the pe-

Power p 0.4 riod search analogousto Eq. (25) and the number of independent frequencies again as M T∆ f . This estimation does not take 0.2 into account the higher variability≈ in the Keplerian periodogram, which depends on the examined eccentricity range, and therefore 0 this FAP is likely to be underestimated. 0.002 0.003 0.004 0.005 0.006 0.007 Another, more extreme example is the planet around Frequency f [1/d] HD 20782 discovered by Jones et al. (2006). Figure 5 shows Fig. 2. Comparison of the normalized Lomb-Scargle (LS), GLS and the RV data for the star taken from O’Toole et al. (2009). Due 1 ω Keplerian periodograms for GJ 1046 ( f = P = 2π ). to the high eccentricity this is a case where LS and GLS fail to find the right period. However, our algorithm for the Keplerian Period [d] periodogram find the same solution as the 2DKLS (P = 591.9d, 500 400 300 200 150 e = 0.97). The Keplerian periodogram in Fig. 6 indicates this pe- .99999 10 riod. This time it is normalised according to Eq. (29) and seems pKep p to suffer from an overall high noise level (caused by many other .9999 Kep, e<0.6 100 pGLS eccentric solutions that will fit the one ’outlier’). However, that p .999 LS 1E3 the period is significant can again be shown just as in the previ- 2

χ ous example. 1E4

Power p .99 For comparison we also show the periodogram with the nor- malisation by the best fit at each frequency (Cumming 2004) .9 1E5 χ2 χ2(ω) −−−−χ1E6 2 N 5 0 0. 0 zKep(ω) = − − (30) 0.002 0.003 0.004 0.005 0.006 0.007 4 χ2(ω) Frequency f [1/d] which is used in the 2DKLS and reveals the power maximum as Fig. 3. The same periodograms as in Fig. 2 with a quasi-logarithmic impressively as in O’Toole et al. (2009, Fig.1b). As Cumming scale for p and a logarithmic scale for χ2 (axis to the right). et al. (1999) mentioned the choice of the normalisation is a mat- ter of taste; the distribution of maximum power is the same. Finally, keep in mind when comparing Fig. 6 with the 2DKLS One may argue,that the second peak has an equalheightsug- in O’Toole et al. (2009, Fig.1b) which shows a slice at e = 0.97, gesting the same significance. On a linear scale it seems so. But that the Keplerian periodogram in Fig. 6 includes all eccentrici- the significance is not a linear function of the power. Cumming ties (0 e 0.99). Also the algorithms are different because we et al. (2008) normalised the Keplerian periodogram as ≤ ≤ also step for T0 and simultaneously fit the longitude of periastron N 5 χ2 χ2(ω) N 5 p (ω) ̟. = 0 − = Kep zKep(ω) − 2 − (29) 4 χ 4 1 pKep(ωbest) best − 6. Conclusions analogous to Eq. (23) and derived the probability distribution Generalised Lomb-Scargle periodogram (GLS), floating-mean N 3 − N 3 4z 4z − 2 periodogram (Cumming et al. 1999), date-compensated discrete Prob(z > z ) = 1 + − 0 1 + 0 . 0 2 N 5 N 5 Fourier transform (DCDFT, Ferraz-Mello 1981), and “spectral − ! − ! significance” (SigSpec, Reegen 2007) at last all mean the same With this we can calculate that the higher peak which is much thing: least-squares spectrum for fitting a sinusoid plus a con- 14 closerto 1hasa 10− times lower probability to be due to noise, stant. Cumming et al. (1999) and Reegen (2007) have already M. Zechmeister and M. K¨urster: The generalised Lomb-Scargle periodogram 7

100 to be attached to each sine and cosine term in each sum (e.g. CCˆ = wiZ(ti)cos ωti Z(ti)cos ωti). 0 We presented an algorithm· for the application of GLS to the KeplerianP periodogram which is the least-squares spectrum for -100 Keplerian orbits. It is an hybrid algorithm that partially applies an analytic solution for linearised parameters and partially steps

RV [m/s] through non-linear parameters. This has to be distinguished from -200 methods that use the best sine fit as an initial guess. With two examples we have demonstrated that our algorithm for the com- -300 putation of the Keplerian periodogram is capable to detect (very) eccentric planets in a systematic and nonrandom way. 1000 1500 2000 2500 3000 3500 4000 4500 Apart from this, the least-squares spectrum analysis (the idea Barycentric Julian Date BJD - 2 450 000 goes back to Van´ıˇcek 1971) with more complicated model func- Fig. 5. The radial velocity (RV) time series of HD 20782. The solid line tions than full sine functions is beyond the scope of this paper is the best Keplerian orbit fit. (e.g. including linear trends, Walker et al. 1995 or multiple sine functions). For the calculation of such periodogramsthe employ- Period [d] ment of the analytical solutions is not essential, but can be faster. 5000 1000 500 300 200 150 800 700 Appendix A: Appendix 600 A.1. Derivation of the generalised Lomb-Scargle 500 periodogram (GLS) 400 300 The derivation of the generalised Lomb-Scargle periodogram is Power z 200 briefly shown. With the sinusoid plus constant model 100 y(t) = a cos ωt + b sin ωt + c 0

0 0.001 0.002 0.003 0.004 0.005 0.006 0.007 the squared difference between the data yi and the model func- Frequency f [1/d] tion y(t) χ2 = W w [y y(t )]2 Fig. 6. Keplerian periodogram for HD 20782. Both are the same i i − i Keplerian periodogram, but the upper one is normalized with the best X 2 fit (Eq. (29)) while the lower one is normalized with the best fit at each is to be minimised. For the minimum χ the partial derivatives frequency (Eq. (30)). Both have by definition the same maximum value. vanish and therefore: 0 = ∂ χ2 = 2W w [y y(t )] cos ωt (A.1) a i i − i i 2 shown the advantages of accounting for a varying zero point and 0 = ∂bχ = 2W X wi[yi y(ti)] sin ωti (A.2) therefore we recommend the usage of the generalised Lomb- − 0 = ∂ χ2 = 2W X w [y y(t )] (A.3) Scargle periodogram (GLS) for the period analysis of time se- c i i − i ries. The implementation is easy as there are only a few modifi- X cations in the sums of the Lomb-Scargle periodogram. These conditions for the minimum give three linear equations: The GLS can be calculated as conveniently as the Lomb- YCˆ CCˆ CSˆ C a Scargle periodogram and in a straight forward manner with an YSˆ = CSˆ SSSˆ b analytical solution while programs applying standard routines  Y   CS 1   c  for fitting sinusoids involve solving a set of linear equations by             inverting a 3x3 matrix repeated at each frequency. The GLS where the abbreviations   in Eqs. (7)-(15)   were applied. can be tailored by concentrating the sums in one loop over the Eliminating c in the first two equations with the last equation data. As already mentioned by Lomb (1976) Eq. (5) (including (c = Y aC bS ) yields: Eqs. (13)–(18)) should be applied for the numerical work. A fast − − calculation of the GLS is especially desirable for large samples, YCˆ Y C CCˆ C C CSˆ C S a = large data sets and/or many frequency steps. It also may be help- YSˆ − Y · S CSˆ − C · S SSˆ − S · S b ful to speed up prewhitening procedures (e.g. Reegen 2007) in " − · # " − · − · # " # case of multifrequency analysis or numerical calculations of the Using again the notations of Eqs. (11)-(15) this can be written significance of a signal with bootstrap methods or Monte Carlo as: YC CCCS a simulations. = . The term generalised Lomb-Scargle periodogram has al- YS CSSS b " # " # " # ready been used by Bretthorst (2001) for the generalisation to So the solution for the parameters a and b is sinusoidal functions of the kind: y(t) = aZ(t)cos ωt+bZ(t) sin ωt with an arbitrary amplitude modulation Z(t) whose time depen- YC SS YS CS YS CC YC CS a = · − · and b = · − · . dence and all parameters are fully specified (e.g. Z(t) can be D D an exponential decay). Without repeating the whole procedure (A.4) given in A.1, A.2 and Sect. 2 it is just mentioned here that the generalisation to y(t) = aZ(t)cos ωt + bZ(t) sin ωt + c will The amplitude of the best-fitting sine function at frequency ω is 2 2 2 result in the same equations with the difference that Z(ti) has given by √a + b . With these solutions the minimum χ can be 8 M. Zechmeister and M. K¨urster: The generalised Lomb-Scargle periodogram written only in terms of the sums Eqs. (10)-(15) when eliminat- References ing the parameters a, b and c as shown below. With the condi- Balan, S. T. & Lahav, O. 2008, ArXiv e-prints, 805 tions for the minimum Eqs. (A.1)-(A.3) it can be seen that: Baluev, R. V. 2008, MNRAS, 385, 1279 Barning, F. J. M. 1963, Bull. Astron. Inst. Netherlands, 17, 22 wi[yi y(ti)]y(ti) = a wi[yi y(ti)] cos ωti Bretthorst, G. L. 2001, in American Institute of Physics Conference Series, Vol. − − 568, Bayesian Inference and Maximum Entropy Methods in Science and X + b Xwi[yi y(ti)] sin ωti Engineering, ed. A. Mohammad-Djafari, 241–245 − Cumming, A. 2004, MNRAS, 354, 1165 Cumming, A., Butler, R. P., Marcy, G. W., et al. 2008, PASP, 120, 531 + c Xwi[yi y(ti)] − Cumming, A., Marcy, G. W., & Butler, R. P. 1999, ApJ, 526, 890 = 0. X Ferraz-Mello, S. 1981, AJ, 86, 619 Ford, E. B. & Gregory, P. C. 2007, in Astronomical Society of the Pacific Therefore, the minimum χ2 can be written as: Conference Series, Vol. 371, Statistical Challenges in Modern Astronomy IV, ed. G. J. Babu & E. D. Feigelson, 189–+ Gilliland, R. L. & Baliunas, S. L. 1987, ApJ, 314, 766 χ2(ω)/W = w [y y(t )]y w [y y(t )]y(t ) i i − i i − i i − i i Horne, J. H. & Baliunas, S. L. 1986, ApJ, 302, 757 Irwin, A. W., Campbell, B., Morbey, C. L., Walker, G. A. H., & Yang, S. 1989, X X =0 PASP, 101, 147 = YYˆ aYCˆ bYSˆ cY Jones, H. R. A., Butler, R. P., Tinney, C. G., et al. 2006, MNRAS, 369, 249 − − − | {z } Koen, C. 1990, ApJ, 348, 700 = YYˆ Y Y a(YCˆ Y C) b(YSˆ Y S ) K¨urster, M., Endl, M., & Reffert, S. 2008, A&A, 483, 869 − · − − · − − · = YY aYC bYS Lomb, N. R. 1976, Ap&SS, 39, 447 − − O’Toole, S. J., Butler, R. P., Tinney, C. G., et al. 2007, ApJ, 660, 1636 O’Toole, S. J., Tinney, C. G., Jones, H. R. A., et al. 2009, MNRAS, 392, 641 where in the last step again the definitions of Eqs. (10)-(12) were Press, W. H. & Rybicki, G. B. 1989, ApJ, 338, 277 applied. Finally a and b can be substituted by Eq. (A.4): Press, W. H., Teukolsky, S. A., Vetterling, W. T., & Flannery, B. P. 1992, Numerical recipes in FORTRAN. The art of scientific computing 2 2 SS YC CC YS CS YC YS (Cambridge: University Press, —c1992, 2nd ed.) χ2(ω)/W = YY · · + 2 · · . − D − D D Reegen, P. 2007, A&A, 467, 1353 Scargle, J. D. 1982, ApJ, 263, 835 When now using the χ2-reduction normalised to unity: Shrager, R. I. 2001, Ap&SS, 277, 519 Van´ıˇcek, P. 1971, Ap&SS, 12, 10 χ2 χ2(ω) Walker, G. A. H., Walker, A. R., Irwin, A. W., et al. 1995, Icarus, 116, 359 ω = 0 − p( ) 2 χ0 and the fact that χ2 = W YY, Eq. (5) will result. 0 ·

A.2. Verification of Eq. (19) Eq. (19) can be verified with the help of trigonometric addition theorems. For this purpose CS must be formulated. Furthermore, the index τ and the notation ϕ = ωτ will be used:

2CS τ = w sin 2(ωt ϕ) i i − X2 w cos(ωt ϕ) w sin(ωt ϕ) − i i − i i − = cos2Xϕ w sin 2ωt Xsin 2ϕ w cos2ωt i i − i i 2(C cosXϕ + S sin ϕ)(S cos ϕXC sin ϕ) − − Expanding the last term yields

2CS τ =2CSˆ cos2ϕ (CCˆ SSˆ ) sin 2ϕ − − 2 C S (cos2 ϕ sin2 ϕ) (C2 S 2) sin ϕ cos ϕ − · − − − and after factoringh cos2ϕ and sin2ϕ: i

2 2 2CS τ =2(CSˆ C S )cos2ϕ CCˆ SSˆ (C S ) sin 2ϕ − · − − − − =2CS cos2ϕ (CC SS) sin 2ϕ  − − So for CS τ = 0, ϕ = ωτ has to be chosen as: 2CS tan2ωτ = CC SS − By the way, replacing the generalised sums CC, SS and CS by the classical ones leads to the original definition forτ ˆ in Eq. (3): 2CSˆ sin 2ωt tan2ωτˆ = = i . CCˆ SSˆ cos2ωti − P P