Astronomy and Space Exploration ES

Higher Education / Exoplanets and observational astrophysics

Lomb–Scargle periodograms

Searching for periodicities in irregularly sampled series: from the classical periodogram to the least-squares Lomb–Scargle periodogram, spectral window and aliases, frequency grid, false-alarm probability (Baluev, bootstrap) and a computational example with a 51 Peg-like series.

⏱ 150 min Fourier analysislinear least squaresnormal equationsconvolutionχ² distributionextreme-value statisticsbootstrap resampling revision

By the end you will be able to:
  • Explain why the classical periodogram and the Nyquist theorem fail with irregular sampling.
  • Derive the Lomb–Scargle periodogram as a least-squares fit of a sinusoid at each frequency, with the phase shift τ that decouples the normal equations.
  • Generalize it with a floating mean and weights and normalize it as a reduction of χ².
  • Compute the spectral window, predict the aliases of nightly sampling and choose the frequency grid.
  • Assess the significance of a peak with the single-frequency false-alarm probability, the Baluev bound and resampling, and know their limits.

1. Motivation: 40 nights, one planet

Illustration: Motivation: 40 nights, one planet

The radial velocities of a star are measured when they can be: at night, without clouds, when the object is high and the telescope has been allocated. The result is a time series {ti,yi,σi}\{t_i, y_i, \sigma_i\} with gaps, repetitions and no constant step. The classical tool, the discrete Fourier transform, presupposes uniform sampling. The Lomb–Scargle periodogram (Lomb 1976; Scargle 1982) solves the problem by fitting a sinusoid at each trial frequency; it is the standard method for finding the period of a planet (and of variable stars, rotation, binaries). But the sampling leaves fingerprints: ghost peaks (aliases) and a false-positive statistics that must be understood in order not to “discover” planets that do not exist. We follow the exposition of VanderPlas (2018).

2. From the classical periodogram to irregular sampling

Illustration: From the classical periodogram to irregular sampling

For NN data yny_n (with zero mean) at tnt_n, the Schuster periodogram is

PS(f)=1N∣∑n=1Nyn e−2πiftn∣2=1N[(∑yncos⁡2πftn)2+(∑ynsin⁡2πftn)2].P_S(f) = \frac{1}{N}\left|\sum_{n=1}^{N} y_n\,e^{-2\pi i f t_n}\right|^2 = \frac1N\left[\Bigl(\sum y_n\cos 2\pi ft_n\Bigr)^2 + \Bigl(\sum y_n\sin 2\pi ft_n\Bigr)^2\right].

With uniform sampling tn=nΔtt_n = n\Delta t it inherits the Fourier properties: it is periodic in ff with period 1/Δt1/\Delta t and symmetric, so that it only carries information up to the Nyquist frequency fNy=1/(2Δt)f_{\rm Ny} = 1/(2\Delta t), and under Gaussian noise PSP_S follows a χ2\chi^2 distribution with two degrees of freedom at each frequency (it is the sum of two squared Gaussians). With irregular sampling both things are lost: there is no fNyf_{\rm Ny} in the strict sense (if the tnt_n are multiples of a unit pp, for example the precision with which they are recorded, then fNy=1/2pf_{\rm Ny} = 1/2p, which can be enormous; Eyer & Bartholdi 1999; VanderPlas 2018, §IV), and the sine and cosine terms are no longer independent, which spoils the statistical distribution.

3. Derivation of the Lomb–Scargle periodogram

Illustration: Derivation of the Lomb–Scargle periodogram

Fitting a sinusoid at each frequency

Instead of a transform, Lomb and Scargle set up a least-squares fit of the model y(t)=Acos⁡ωt+Bsin⁡ωty(t) = A\cos\omega t + B\sin\omega t, ω=2πf\omega = 2\pi f, to the (centered) data. The function to minimize is χ2(f)=∑n[yn−Acos⁡ωtn−Bsin⁡ωtn]2\chi^2(f) = \sum_n[y_n - A\cos\omega t_n - B\sin\omega t_n]^2 and the normal equations ∂χ2/∂A=∂χ2/∂B=0\partial\chi^2/\partial A = \partial\chi^2/\partial B = 0 are

(CCCSCSSS)(AB)=(YCYS),CC=∑cos⁡2ωtn, SS=∑sin⁡2ωtn, CS=∑cos⁡ωtnsin⁡ωtn, YC=∑yncos⁡ωtn, YS=∑ynsin⁡ωtn.\begin{pmatrix} CC & CS \\ CS & SS\end{pmatrix}\begin{pmatrix}A\\B\end{pmatrix} = \begin{pmatrix}YC\\YS\end{pmatrix}, \qquad CC = \sum\cos^2\omega t_n,\ SS = \sum\sin^2\omega t_n,\ CS = \sum\cos\omega t_n\sin\omega t_n,\ YC = \sum y_n\cos\omega t_n,\ YS = \sum y_n\sin\omega t_n .

The reduction in χ2\chi^2 from including the sinusoid is Δχ2=χ02−χ2(f)=(YC,YS) M−1(YC,YS)T\Delta\chi^2 = \chi^2_0 - \chi^2(f) = (YC, YS)\,\mathbf M^{-1}(YC, YS)^T, with χ02=∑yn2\chi^2_0 = \sum y_n^2 (problem 1).

The phase shift τ

The cross term CSCS can be made to vanish by shifting the time origin: with ω(tn−τ)\omega(t_n - \tau) instead of ωtn\omega t_n, CS(τ)=12∑sin⁡2ω(tn−τ)=12[cos⁡2ωτ∑sin⁡2ωtn−sin⁡2ωτ∑cos⁡2ωtn]=0CS(\tau) = \tfrac12\sum\sin 2\omega(t_n - \tau) = \tfrac12[\cos 2\omega\tau\sum\sin 2\omega t_n - \sin 2\omega\tau\sum\cos 2\omega t_n] = 0 if

tan⁡2ωτ=∑nsin⁡2ωtn∑ncos⁡2ωtn.\tan 2\omega\tau = \frac{\sum_n\sin 2\omega t_n}{\sum_n\cos 2\omega t_n} .

With that choice the matrix is diagonal and Δχ2=YC2/CC+YS2/SS\Delta\chi^2 = YC^2/CC + YS^2/SS (everything evaluated at tn−τt_n - \tau). Scargle (1982) defined the periodogram as half of that quantity:

  PLS(f)=12{[∑nyncos⁡ω(tn−τ)]2∑ncos⁡2ω(tn−τ)+[∑nynsin⁡ω(tn−τ)]2∑nsin⁡2ω(tn−τ)}  \boxed{\;P_{\rm LS}(f) = \frac12\left\{\frac{\bigl[\sum_n y_n\cos\omega(t_n - \tau)\bigr]^2}{\sum_n\cos^2\omega(t_n-\tau)} + \frac{\bigl[\sum_n y_n\sin\omega(t_n - \tau)\bigr]^2}{\sum_n\sin^2\omega(t_n-\tau)}\right\}\;}

(VanderPlas 2018, eqs. 33–34). Two properties justify the τ\tau: the periodogram is invariant under time translations and, under white Gaussian noise of variance σ2\sigma^2, PLS/σ2P_{\rm LS}/\sigma^2 follows exactly an exponential distribution (χ² with 2 d.o.f.) at each frequency, like the classical periodogram. For uniform sampling, CC=SS=N/2CC = SS = N/2 and PLS=PSP_{\rm LS} = P_S. For a pure sinusoid of amplitude aa, PLS(f0)≈Na2/4P_{\rm LS}(f_0) \approx Na^2/4 (test in lombscargle.ts).

Generalized periodogram and normalization

Two practical improvements (Zechmeister & Kürster 2009): weights wn=1/σn2w_n = 1/\sigma_n^2 and a floating mean, that is, fitting y=c+Acos⁡ωt+Bsin⁡ωty = c + A\cos\omega t + B\sin\omega t instead of subtracting the sample mean. The difference matters when the phase coverage is incomplete: the mean of the data is not that of the model, and centering on it can suppress the true peak (VanderPlas 2018, §VI.2). In that case the normal equations are 3×33\times3; potenciaLS solves them by eliminating cc analytically. We normalize as the fraction of explained variance,

P(f)=χref2−χ2(f)χref2∈[0,1],χref2=∑nwn(yn−yˉw)2,P(f) = \frac{\chi^2_{\rm ref} - \chi^2(f)}{\chi^2_{\rm ref}} \in [0, 1], \qquad \chi^2_{\rm ref} = \sum_n w_n(y_n - \bar y_w)^2 ,

(VanderPlas 2018, eq. 59) with P=1P = 1 for a noiseless sinusoid and P=0P = 0 if the sinusoid improves nothing.

4. Spectral window and aliases

Illustration: Spectral window and aliases

The periodogram of the data is, approximately, that of the underlying process convolved with the spectral window, the periodogram of the sampling itself:

W(f)=1N2∣∑ne−2πiftn∣2,W(f) = \frac{1}{N^2}\left|\sum_n e^{-2\pi i f t_n}\right|^2 ,

with W(0)=1W(0) = 1 (VanderPlas 2018, eq. 48). Each peak of WW at fw≠0f_w \ne 0 replicates the true signal at fobs=∣f0±nfw∣f_{\rm obs} = |f_0 \pm nf_w| (eqs. 45–47). For nightly observations from the ground the dominant peak is fw=1f_w = 1 d⁻¹; the synodic month (29.5 d) and the year also appear. The structure of WW also sets the width of the peaks, δf≈1/T\delta f \approx 1/T with TT the baseline, and hence the recommended grid:

Δf=1n0T (n0=5–10),fmin⁡=0,Neval=n0Tfmax⁡,\Delta f = \frac{1}{n_0 T}\ (n_0 = 5\text{–}10), \qquad f_{\min} = 0, \qquad N_{\rm eval} = n_0 T f_{\max} ,

with fmax⁡f_{\max} chosen by physics (the shortest plausible period) or by a “pseudo-Nyquist” of the sampling (VanderPlas 2018, §VII.1). A grid uniform in period undersamples the high frequencies and is a frequent mistake.

5. Significance: false-alarm probability

Illustration: Significance: false-alarm probability

The operational question is: if there were no signal, with what probability would the noise produce a peak as high as the observed one? This is the false-alarm probability (FAP). For the normalization of §3 with floating mean and Gaussian noise, at one frequency fixed in advance (Cumming 2004; VanderPlas 2018, eq. 53),

FAP1(z)=Pr⁡(P>z)=(1−z)(N−3)/2.\mathrm{FAP}_1(z) = \Pr(P > z) = (1 - z)^{(N-3)/2} .

But we search for the maximum over many frequencies. With NeffN_{\rm eff} independent frequencies, FAP≈1−[1−FAP1(z)]Neff\mathrm{FAP} \approx 1 - [1 - \mathrm{FAP}_1(z)]^{N_{\rm eff}} and the naive estimate Neff≈fmax⁡TN_{\rm eff} \approx f_{\max}T tends to underestimate the real FAP. The Baluev bound (2008), based on the extreme-value theory of continuous processes, does not need NeffN_{\rm eff}:

FAP(z)≲1−[1−FAP1(z)]e−τ(z),τ(z)≈Weff (1−z)(N−4)/2z,Weff=fmax⁡4π Var(tn)\mathrm{FAP}(z) \lesssim 1 - \bigl[1 - \mathrm{FAP}_1(z)\bigr]e^{-\tau(z)}, \qquad \tau(z) \approx W_{\rm eff}\,(1 - z)^{(N-4)/2}\sqrt z, \qquad W_{\rm eff} = f_{\max}\sqrt{4\pi\,\mathrm{Var}(t_n)}

(VanderPlas 2018, eqs. 55–56). It is an upper bound valid for windows without strong structure; with intense aliases it may overestimate. The empirical alternative is the bootstrap: permute the yny_n over the same tnt_n many times, recompute the periodogram and record the maximum; it is expensive (to estimate a FAP rr one needs ≳10/r\gtrsim 10/r periodograms) and does not handle correlated noise. Implementation: fapUnaFrecuencia, fapBaluev, fapBootstrap.

What the FAP does not say. It is not the probability that the signal is periodic, nor that the peak is at the correct frequency: an alias can be nearly as high as the true peak (§6). And the uncertainty of the period is not the width of the peak: the width (≈1/T\approx 1/T) depends neither on NN nor on the S/N, whereas the precision does, σf≈1T2N Σ2\sigma_f \approx \frac{1}{T}\sqrt{\frac{2}{N\,\Sigma^2}} with Σ\Sigma the mean signal-to-noise ratio (VanderPlas 2018, eq. 52), and in any case it ignores the risk of being on the wrong peak.

Simulator

Generate a 51 Peg-like radial-velocity series and change the sampling pattern from “random” to “nights only”: the aliases at f±1f \pm 1 c/d of §4 appear. Reduce NN or raise σ\sigma until the peak no longer exceeds the 1% FAP line, and fold the data with the alias to see why a “pretty” folded curve is not enough as proof.

Detected P
4.229 d (0.2365 cycles/d)
True P
4.230 d · error -0.03 %
Peak power
0.911 (1 % FAP threshold: 0.162)
FAP (Baluev)
< 0.01 % · significant
Verdict
matches the true period
Grid
3515 frequencies, Δf = 1.14e-3 c/d
Daily aliases of the peak
1.31 d, 0.809 d, 0.567 d, 0.447 d
Folded with
P = 4.229 d (detected)
Generalized Lomb–Scargle periodogram (floating mean; Zechmeister and Kürster 2009): at each frequency, y = c + a cos 2πft + b sin 2πft is fitted by least squares and P(f) = 1 − χ²(f)/χ²_ref ∈ [0, 1]. Grid Δf = 1/(n₀T) with n₀ ≤ 5 (VanderPlas 2018). The red line is the power whose false-alarm probability (Baluev 2008 bound) is 1 %. Observing only at night amounts to multiplying the signal by a 1-day comb: copies of the peak appear in the periodogram at f ± 1 cycle/day (aliases, yellow lines); the spectral window |Σ e^(−2πiftᵢ)|²/N² shows where. The faint green line is the true frequency. Reproducible synthetic data (mulberry32); Cepheid and RR Lyrae curves with three harmonics and typical parameters (Simon and Lee 1981; Simon and Teays 1982), not of a specific star.

6. Computational example: a 51 Peg-like series

Illustration: Computational example: a 51 Peg-like series

With velocidadRadial.ts and lombscargle.ts we generate 40 measurements on 40 different nights within an interval of 61 d (one measurement per night at a random time), with P=4.2293P = 4.2293 d, K=59K = 59 m s⁻¹, circular orbit and noise σ=13\sigma = 13 m s⁻¹ (ELODIE), grid Δf=1/(10T)\Delta f = 1/(10T) up to fmax⁡=2f_{\max} = 2 d⁻¹:

QuantityResult
Periodogram peakf=0.2361f = 0.2361 d⁻¹, P=4.235P = 4.235 d, Pmax=0.880P_{\text{max}} = 0.880
Grid stepΔf=0.0016\Delta f = 0.0016 d⁻¹ ⇒ ΔP=P2Δf=0.03\Delta P = P^2\Delta f = 0.03 d
FAP1\mathrm{FAP}_1 (one frequency)9.8×10−189.8\times10^{-18}
Baluev FAP (Weff=122W_{\rm eff} = 122)3.2×10−153.2\times10^{-15}
Window at f=1f = 1 d⁻¹W=0.886W = 0.886 (very strong diurnal alias)
Alias 1−f0=0.76361 - f_0 = 0.7636 d⁻¹ (P=1.310P = 1.310 d)power 0.863
Alias 1+f0=1.23641 + f_0 = 1.2364 d⁻¹ (P=0.809P = 0.809 d)power 0.708
Pure noise (same tnt_n): maximum0.373, Baluev FAP 0.017
Bootstrap versus Baluev at z=0.4z = 0.40.033 versus 0.008

Lessons of the experiment: (i) the period is recovered within the resolution of the grid; (ii) the peak is overwhelmingly significant, but (iii) the 1.31 d alias has 98% of the power of the true one: with a single season of nightly data one cannot decide between 4.23 d and 1.31 d from the periodogram alone (one needs observations at different times of night, or from another hemisphere, or a second periodogram after subtracting the candidate); (iv) in pure noise the maximum reaches 0.37, and Baluev (0.017) is more optimistic than the bootstrap (0.033) because the window is highly structured: for nightly windows it is advisable to calibrate with resampling.

7. Error analysis and cost

Illustration: Error analysis and cost
  • Cost. The direct computation is O(N Neval)O(N\,N_{\rm eval}) with Neval=n0Tfmax⁡N_{\rm eval} = n_0Tf_{\max}: for T=10T = 10 years, fmax⁡=10f_{\max} = 10 d⁻¹ and n0=10n_0 = 10 that is 3.65×1053.65\times10^5 frequencies; the Press & Rybicki (1989) algorithm with FFT lowers it to O(Nevallog⁡Neval)O(N_{\rm eval}\log N_{\rm eval}).
  • Grid error. If Δf>1/T\Delta f > 1/T the peaks can fall between nodes and up to half of the power can be lost; with n0=5n_0 = 5 the maximum loss is ≈10 %\approx 10\,\% (sinc² width).
  • Red noise. Stellar activity produces correlated power at periods from days to months; none of the FAPs above is valid, and the stellar-rotation peaks (and their aliases) compete with the planets. It is modeled with Gaussian processes or simultaneous activity indicators are used.
  • Multiple signals. The periodogram is linear in a single sinusoid; two planets are searched for iteratively (“pre-whitening”: subtract the best fit and repeat), or with multi-frequency fits.

Problems

1. (Proof) Reduction of χ². Show that for the linear model y=∑kθkgk(t)y = \sum_k\theta_k g_k(t) with normal matrix M\mathbf M and vector b=(∑yngk(tn))\mathbf b = (\sum y_n g_k(t_n)), the minimum of χ2\chi^2 is χ02−bTM−1b\chi^2_0 - \mathbf b^T\mathbf M^{-1}\mathbf b, and specialize to the two-parameter model (cosine and sine) with the matrix of §3.

Proof

χ2(θ)=∑n(yn−∑kθkgkn)2=χ02−2θTb+θTMθ\chi^2(\boldsymbol\theta) = \sum_n(y_n - \sum_k\theta_kg_{kn})^2 = \chi^2_0 - 2\boldsymbol\theta^T\mathbf b + \boldsymbol\theta^T\mathbf M\boldsymbol\theta with Mjk=∑ngjngknM_{jk} = \sum_ng_{jn}g_{kn}. The gradient −2b+2Mθ=0-2\mathbf b + 2\mathbf M\boldsymbol\theta = 0 gives θ^=M−1b\hat{\boldsymbol\theta} = \mathbf M^{-1}\mathbf b and, substituting, χmin⁡2=χ02−2bTM−1b+bTM−1b=χ02−bTM−1b\chi^2_{\min} = \chi^2_0 - 2\mathbf b^T\mathbf M^{-1}\mathbf b + \mathbf b^T\mathbf M^{-1}\mathbf b = \chi^2_0 - \mathbf b^T\mathbf M^{-1}\mathbf b. With g1=cos⁡ωtg_1 = \cos\omega t, g2=sin⁡ωtg_2 = \sin\omega t: M=(CCCSCSSS)\mathbf M = \begin{pmatrix}CC & CS\\ CS & SS\end{pmatrix}, b=(YC,YS)\mathbf b = (YC, YS) and Δχ2=SS YC2−2CS YC YS+CC YS2CC SS−CS2\Delta\chi^2 = \dfrac{SS\,YC^2 - 2CS\,YC\,YS + CC\,YS^2}{CC\,SS - CS^2}, which reduces to YC2/CC+YS2/SSYC^2/CC + YS^2/SS when CS=0CS = 0. ■\blacksquare

2. (Proof) The phase shift τ. Show that with tan⁡2ωτ=∑sin⁡2ωtn/∑cos⁡2ωtn\tan 2\omega\tau = \sum\sin 2\omega t_n/\sum\cos 2\omega t_n one has ∑ncos⁡ω(tn−τ)sin⁡ω(tn−τ)=0\sum_n\cos\omega(t_n - \tau)\sin\omega(t_n - \tau) = 0, and that PLSP_{\rm LS} is invariant if all the tnt_n are shifted by t0t_0.

Proof

∑cos⁡ω(tn−τ)sin⁡ω(tn−τ)=12∑sin⁡(2ωtn−2ωτ)=12[cos⁡2ωτ S2−sin⁡2ωτ C2]\sum\cos\omega(t_n-\tau)\sin\omega(t_n-\tau) = \tfrac12\sum\sin(2\omega t_n - 2\omega\tau) = \tfrac12[\cos 2\omega\tau\,S_2 - \sin 2\omega\tau\,C_2] with S2=∑sin⁡2ωtnS_2 = \sum\sin 2\omega t_n, C2=∑cos⁡2ωtnC_2 = \sum\cos 2\omega t_n; it vanishes if tan⁡2ωτ=S2/C2\tan 2\omega\tau = S_2/C_2. If tn→tn+t0t_n \to t_n + t_0, then S2,C2S_2, C_2 rotate by the angle 2ωt02\omega t_0 and the solution becomes τ+t0\tau + t_0: the arguments ω(tn−τ)\omega(t_n - \tau) do not change and neither does PLSP_{\rm LS}. ■\blacksquare

3. Aliases. A planet has P=3.6P = 3.6 d. With nightly observations (window at 1 d⁻¹) and over one year (window at 1/365 d⁻¹), list the periods of the first-order aliases. Which of them would be confused with a “super-Earth at 1.4 d”? What observation breaks the degeneracy?

Show solution

f0=0.2778f_0 = 0.2778 d⁻¹. Diurnal aliases: 1−f0=0.72221 - f_0 = 0.7222 ⇒ 1.385 d; 1+f0=1.27781 + f_0 = 1.2778 ⇒ 0.783 d. Annual aliases: f0±0.00274f_0 \pm 0.00274 ⇒ 3.565 and 3.636 d (indistinguishable with TT shorter than a few years). The 1.385 d alias is the “1.4 d” candidate. Observing at different phases of the day (several measurements per night at different times, or telescopes at different longitudes) reduces the window at 1 d⁻¹; or compare the χ2\chi^2 of the two fits with many data.

4. FAP. With N=40N = 40 and fmax⁡=2f_{\max} = 2 d⁻¹ over T=61T = 61 d with Var(t)≈T2/12\mathrm{Var}(t) \approx T^2/12: (a) compute FAP1\mathrm{FAP}_1 and the Baluev bound for z=0.3z = 0.3, 0.50.5 and 0.880.88; (b) what height zz is needed for FAP = 1%? (c) Why is the single-frequency FAP so small compared with that of the maximum?

Show solution

Weff=24π×612/12=2×61×1.023=125W_{\rm eff} = 2\sqrt{4\pi\times61^2/12} = 2\times61\times1.023 = 125. (a) z=0.3z = 0.3: FAP1=0.718.5=1.4×10−3\mathrm{FAP}_1 = 0.7^{18.5} = 1.4\times10^{-3}, τ=125×0.718×0.548=0.112\tau = 125\times0.7^{18}\times0.548 = 0.112, FAP =1−0.9986e−0.112=0.107= 1 - 0.9986e^{-0.112} = 0.107. z=0.5z = 0.5: FAP1=2.7×10−6\mathrm{FAP}_1 = 2.7\times10^{-6}, τ=125×0.518×0.707=3.4×10−4\tau = 125\times0.5^{18}\times0.707 = 3.4\times10^{-4}, FAP ≈3.4×10−4\approx 3.4\times10^{-4}. z=0.88z = 0.88: FAP1=10−17\mathrm{FAP}_1 = 10^{-17}, τ≈125×0.1218×0.94≈3×10−15\tau \approx 125\times0.12^{18}\times0.94 \approx 3\times10^{-15}. (b) Solving τ(z)≈0.01\tau(z) \approx 0.01: z≈0.42z \approx 0.42. (c) Because the maximum is searched for among ∼Weff\sim W_{\rm eff} independent peaks: the bound multiplies approximately by that number.

5. (Proof) Single-frequency distribution. For Gaussian noise of variance σ2\sigma^2 and uniform sampling, show that PLS(f)/σ2P_{\rm LS}(f)/\sigma^2 follows an exponential of mean 1, that is, Pr⁡(PLS>zσ2)=e−z\Pr(P_{\rm LS} > z\sigma^2) = e^{-z}, at a frequency that is neither 0 nor Nyquist. Why does it change to (1−z)(N−3)/2(1 - z)^{(N-3)/2} with the normalization of §3?

Proof

YC/CCYC/\sqrt{CC} and YS/SSYS/\sqrt{SS} are linear combinations of Gaussians, with mean 0 and variance σ2\sigma^2 (by construction of the denominators) and uncorrelated (because CS=0CS = 0 after the phase shift τ): they are two independent normals N(0,σ2)N(0, \sigma^2). Half the sum of their squares divided by σ2\sigma^2 is 12χ22\tfrac12\chi^2_2, whose survival function is e−ze^{-z}. With the normalization P=Δχ2/χref2P = \Delta\chi^2/\chi^2_{\rm ref} and floating mean, Δχ2∼χ22\Delta\chi^2 \sim \chi^2_2 and χ2(f)∼χN−32\chi^2(f) \sim \chi^2_{N-3} are independent, so that PP follows a Beta(1,(N−3)/2)(1, (N-3)/2) distribution, with Pr⁡(P>z)=(1−z)(N−3)/2\Pr(P > z) = (1-z)^{(N-3)/2} (Cumming 2004); for N→∞N \to \infty and small zz, (1−z)N/2→e−Nz/2(1-z)^{N/2} \to e^{-Nz/2}, which recovers the exponential. ■\blacksquare

6. (Computational) Reproduce the example of §6. Generate the series, compute the generalized periodogram, the spectral window and the three FAPs (one frequency, Baluev, bootstrap with 300 permutations) for the peak and for z=0.4z = 0.4 in pure noise. Then subtract the fitted sinusoid and recompute the periodogram: does the 1.31 d alias disappear?

Outline in Python
import numpy as np
rng = np.random.default_rng(2024)
t = np.sort(rng.choice(np.arange(61), 40, replace=False) + 0.9 + 0.2*rng.random(40))
P0, K, s = 4.2293, 59.0, 13.0
y = K*np.cos(2*np.pi*t/P0) + s*rng.standard_normal(40)
def pot(t, y, f):               # generalized periodogram, normalization [0, 1]
    X = np.c_[np.ones_like(t), np.cos(2*np.pi*f*t), np.sin(2*np.pi*f*t)]
    r = y - X @ np.linalg.lstsq(X, y, rcond=None)[0]
    return 1 - (r @ r) / ((y - y.mean()) @ (y - y.mean()))
T = t.max() - t.min(); fr = np.arange(0, 2, 1/(10*T))
P = np.array([pot(t, y, f) for f in fr]); k = P.argmax()
W = np.abs(np.exp(-2j*np.pi*np.outer(fr, t)).sum(1))**2 / 40**2
N = 40; z = P[k]; Weff = 2*np.sqrt(4*np.pi*t.var())
fap1 = (1-z)**((N-3)/2); fap_b = 1 - (1-fap1)*np.exp(-Weff*(1-z)**((N-4)/2)*np.sqrt(z))
boot = np.mean([max(pot(t, rng.permutation(y), f) for f in fr) >= z for _ in range(300)])
print(1/fr[k], z, fap1, fap_b, boot, W[np.argmin(abs(fr-1))])

After subtracting the fit at 4.23 d, the residual periodogram shows no peak at 1.31 d: the alias was a reflection of the signal, not an independent signal. Had the alias been subtracted, the residual would keep power at 4.23 d.

7. Grid. For a campaign of T=8T = 8 years with fmax⁡=1f_{\max} = 1 d⁻¹ and n0=10n_0 = 10, how many frequencies must be evaluated? If instead a grid uniform in period between 1 and 3000 d with the same number of points is used, what is the step in frequency near P=1P = 1 d and near P=1000P = 1000 d? Which peaks are lost?

Show solution

Neval=n0Tfmax⁡=10×2922×1=29 220N_{\rm eval} = n_0Tf_{\max} = 10\times2922\times1 = 29\,220. With step ΔP=2999/29 220=0.103\Delta P = 2999/29\,220 = 0.103 d: near P=1P = 1 d, Δf=ΔP/P2=0.10\Delta f = \Delta P/P^2 = 0.10 d⁻¹, 300 times larger than the width 1/T=3.4×10−41/T = 3.4\times10^{-4} d⁻¹ (almost all the short-period peaks are lost); near 1000 d, Δf=10−7\Delta f = 10^{-7} d⁻¹, a useless oversampling of 3000 points per peak.

✦ Self-assessment

  1. 1. The Lomb–Scargle periodogram at a frequency f is equivalent to
  2. 2. What is Scargle's phase shift τ for?
  3. 3. A 4.23 d signal observed only at night produces aliases at
  4. 4. The recommended step of the frequency grid is
  5. 5. The false-alarm probability of the highest peak
  6. 6. The width of the periodogram peak (≈ 1/T)
Answer all the questions to check.

Further reading

  • VanderPlas, J. T. (2018). Understanding the Lomb–Scargle periodogram, ApJS 236, 16: the conceptual guide this lesson follows; includes code.
  • Scargle (1982), ApJ 263, 835 and Lomb (1976), Ap&SS 39, 447: the original papers; Zechmeister & Kürster (2009), A&A 496, 577: floating mean and weights.
  • Baluev (2008), MNRAS 385, 1279: the FAP bound; Cumming (2004), MNRAS 354, 1165: FAP and detectability in radial-velocity surveys.
  • Perryman (2018). The Exoplanet Handbook, §2.3; Gregory (2005). Bayesian Logical Data Analysis, ch. 13: the periodogram from the Bayesian perspective (Bretthorst).
🍎 Teacher guide
Time
2 classes of 75 min
Learning outcome
By the end, the student derives the Lomb–Scargle periodogram as a least-squares fit, predicts the aliases from the spectral window and assesses the significance of a peak with the Baluev FAP and by resampling, knowing their limits.
Evidence of learning
Submission of problem 6 (periodogram, window, three FAPs and pre-whitening) and of problem 4 with the calculations of the Baluev bound.

Materials

  • Python 3 with NumPy (optionally astropy.timeseries.LombScargle for comparison)
  • src/lib/math/lombscargle.ts and velocidadRadial.ts
  • Figures 17 and 24 of VanderPlas 2018 (window and aliases)

Suggested sequence

Class 1. Fourier with irregular sampling (§2); full derivation of Lomb–Scargle with the phase shift τ (§3, problems 1 and 2). Spectral window and aliases (§4) with the 51 Peg example: predict 1.31 d before computing.

Class 2. Single-frequency FAP, Baluev and bootstrap (§5) with problem 4; lab with problem 6, including pre-whitening. Closing: list of what the periodogram does not say (§7).

Common mistakes

  • Applying the Nyquist frequency 1/(2 mean Δt) to irregular data: no such limit exists; use the pseudo-Nyquist or the physics.
  • Taking the width of the peak as the error of the period.
  • Interpreting a small FAP as proof that the period is that of the highest peak and not an alias.
  • Using grids uniform in period.
  • Forgetting the floating mean with incomplete phase coverage.
Key terms in this lesson (10)

Glossary terms that appear in the text. Each one links to its full entry.

  • Periodogram A tool for finding hidden rhythms in data taken at irregular times: for each possible period it says how well a wave "fits". That is how the period of a planet is found in radial velocity data.
  • Linear regression Drawing the line that best passes "through the middle" of a cloud of points. That is how Hubble found that the velocity of galaxies grows with their distance, and the slope of that line is his famous constant.
  • Mass and weight Mass is how much "stuff" you are made of, and it is the same anywhere. Weight is the force with which a planet pulls on you: on the Moon you would weigh six times less, but your mass would be the same.
  • Bayesian inference A way of reasoning with probabilities: you start from what you believe (the prior), look at the data and update your belief (the posterior). It is how astronomers estimate the mass of a planet together with its uncertainty.
  • Degeneracy pressure A pressure that appears when matter is so tightly packed that the electrons cannot get any closer together, because of a rule of quantum physics. It holds up white dwarfs even when they are cold.
  • Exoplanet A planet that orbits a star other than the Sun. More than 5000 have been known since 1995; most were discovered by watching them block a tiny bit of their star's light as they pass in front of it.
  • Orbit The path one body follows around another because of gravity: the Moon around Earth, Earth around the Sun. Almost all are ellipses, slightly flattened ovals.
  • Orbital nodes The two points where the Moon's orbit crosses the plane of Earth's orbit. There are eclipses only when the new or full moon happens near a node; that is why there are not eclipses every month.
  • Seasons of the year Spring, summer, fall and winter. They do not happen because Earth gets closer to the Sun, but because its axis is tilted: for half the year one hemisphere receives sunlight more directly and for more hours.
  • Synodic month The time from one new moon to the next: 29 and a half days. It is longer than the Moon's actual trip around Earth because, in the meantime, Earth also moved along its orbit around the Sun.

See the whole glossary →

References

  • VanderPlas, J. T. (2018). Understanding the Lomb–Scargle periodogram. ApJS 236, 16. doi:10.3847/1538-4365/aab766. arXiv:1703.09824.
  • Lomb, N. R. (1976). Least-squares frequency analysis of unequally spaced data. Ap&SS 39, 447. doi:10.1007/BF00648343.
  • Scargle, J. D. (1982). Studies in astronomical time series analysis. II. ApJ 263, 835. doi:10.1086/160554.
  • Zechmeister, M. & Kürster, M. (2009). The generalised Lomb–Scargle periodogram. A&A 496, 577. doi:10.1051/0004-6361:200811296.
  • Baluev, R. V. (2008). Assessing the statistical significance of periodogram peaks. MNRAS 385, 1279. doi:10.1111/j.1365-2966.2008.12689.x.
  • Cumming, A. (2004). Detectability of extrasolar planets in radial velocity surveys. MNRAS 354, 1165.
  • Perryman, M. (2018). The Exoplanet Handbook, 2nd ed., §2.3 (Periodogram analysis).
  • Gregory, P. C. (2005). Bayesian Logical Data Analysis for the Physical Sciences, Cambridge University Press, ch. 13.

Simulators for this lesson: Periodogram: hunting periods in irregular data