---
title: Lomb-Scargle Periodogram Explained
url: https://www.emergentmind.com/topics/lomb-scargle-periodogram
type: topic
---

# Lomb-Scargle Periodogram Explained

The Lomb-Scargle periodogram (LSP) is a foundational spectral analysis tool for detecting and characterizing periodic signals in unevenly sampled time series, especially prevalent in astronomical applications where observational cadences are irregular. It generalizes classical Fourier-based periodograms to accommodate gaps, variable errors, and nonuniform time coverage, providing statistically meaningful period estimates and significance metrics under well-defined noise assumptions.

## 1. Mathematical Foundations and Derivation

The standard LSP is derived as a least-squares solution to the fit of a single-frequency sinusoid to an unevenly sampled dataset. Given $N$ measurements $\{(t_i, d_i, \sigma_i)\}$, where $t_i$ are observation times, $d_i$ are observed values, and $\sigma_i$ are (Gaussian) uncertainties, the measurement model is:
\[
d_i = A \cos(2\pi f t_i - \theta) + B \sin(2\pi f t_i - \theta) + \gamma + \epsilon_i, \quad \epsilon_i \sim \mathcal{N}(0, \sigma_i^2).
\]
Weights are defined as $w_i = 1/\sigma_i^2$. To decorrelate the sinusoidal basis, a phase offset $\theta$ is introduced such that the weighted cross-terms vanish:
\[
\theta(f) = \frac{1}{2} \arctan2\left(\sum_i w_i \sin(4\pi f t_i),\; \sum_i w_i \cos(4\pi f t_i)\right).
\]
The essential LSP power statistic at frequency $f$ is then:
\[
P_{\mathrm{LS}}(f) = \frac{1}{2}
\left(
\frac{[\sum_i w_i (d_i-\bar d) \cos(2\pi f t_i-\theta)]^2}{\sum_i w_i \cos^2(2\pi f t_i-\theta)} +
\frac{[\sum_i w_i (d_i-\bar d) \sin(2\pi f t_i-\theta)]^2}{\sum_i w_i \sin^2(2\pi f t_i-\theta)}
\right),
\]
with $\bar d$ as the weighted mean. Under the null hypothesis of white Gaussian noise, $P_{\mathrm{LS}}$ is exponentially distributed at each frequency: $\Pr\{P_{\mathrm{LS}} > z\} = \exp(-z)$ [1301.4826, 1807.01595].

## 2. Statistical Properties and Assumptions

The periodogram formalism relies on several core assumptions:
- The noise $\epsilon_i$ is white, zero-mean, and Gaussian.
- The signal, if present, is well-modeled as a sinusoid at each frequency.
  
The phase offset $\theta$ ensures weak-sense decorrelation between the fitted sine and cosine components, even under uneven sampling [1703.09824, 1301.4826]. The false-alarm probability (FAP) is controlled via the exponential tail of $P_{\mathrm{LS}}(f)$, e.g., for $M$ independent frequencies:
\[
\mathrm{FAP}(z) \approx 1-\bigl[1-\exp(-z)\bigr]^M,
\]
where $M$ is the effective number of independent frequencies, often $\sim N/2$ for modest irregularity [1807.01595].

If the signal mean is nonzero or the data contain a secular trend, spurious power can appear throughout the spectrum. Remedies include subtracting the mean or adopting a generalized ("floating-mean") formulation, in which a constant offset is refitted at each frequency [1412.0467, 1801.03236, 2402.11258].

## 3. Generalizations: Weighted, Floating-Mean, and Bayesian Formulations

### Generalized Lomb-Scargle

The generalized Lomb-Scargle periodogram (GLS) fits the model $d_i = A\cos(2\pi f t_i) + B\sin(2\pi f t_i) + C + \epsilon_i$ at each $f$, where $C$ is a frequency-dependent floating mean. The reduction in $\chi^2$ from the constant model is computed as:
\[
P_{\mathrm{GLS}}(f) = \frac{1}{\chi_0^2}
\left(
\frac{C(f)^2}{CC(f)} + \frac{S(f)^2}{SS(f)}
\right),
\]
where $C(f)$, $S(f)$, $CC(f)$, and $SS(f)$ are frequency-shifted, weighted sums of the data, and $\chi_0^2$ is the total weighted variance about the mean [2402.11258, 1912.06970].

### Bayesian Generalized Lomb-Scargle (BGLS)

The BGLS marginalizes the Gaussian likelihood over $A$, $B$, and $C$ (and optionally trend parameters), yielding a posterior for each frequency:
\[
P(f|D) \propto
\frac{1}{\sqrt{|K|\,CC\,SS}}
\exp\left[M - \frac{L^2}{4K}\right],
\]
where $K$, $L$, and $M$ are explicit combinations of the weighted sums (see Sect. 2.2 of [1412.0467]). This formulation ensures positive-definite probability densities, robustly quantifies relative likelihoods between frequency hypotheses, and reduces to the classical GLS in the limit of large datasets and flat priors [1412.0467, 1712.08235].

Bayesian generalizations can be further extended to include linear trends (BGLST), Gaussian priors on nuisance parameters, and heteroscedastic noise, yielding closed-form marginal likelihoods for model selection and period estimation even in the presence of red noise or secular trends [1712.08235].

## 4. Computational Algorithms and Efficiency

The computational cost for a full periodogram scales as $\mathcal{O}(N\times M)$, where $N$ is the number of data points and $M$ the number of trial frequencies. Direct evaluation is typically tractable ($\lesssim$ seconds for $N\sim10^3$, $M\sim10^4$) [1412.0467, 2105.04006]. Fast algorithms leverage non-uniform FFT (NUFFT) routines to accelerate large-scale searches:
- Brute-force LSP: $\mathcal{O}(N M)$, suitable for moderate sample sizes.
- Press & Rybicki extirpolation+FFT: $\mathcal{O}(N + M\log M)$ [2409.08090].
- State-of-the-art NUFFT (e.g., finufft, nifty-ls): $\mathcal{O}(N\log\epsilon^{-1} + M\log M)$, with relative errors down to $10^{-8}$–$10^{-11}$ at double precision and orders-of-magnitude speedups on CPU and GPU [2409.08090, 2105.04006, 1007.1658].

Optimal frequency grids oversample the Rayleigh resolution (step $\Delta f \lesssim 1/(4T)$ for total time baseline $T$) by a factor 4–5 to avoid missing narrow peaks [1412.0467, 2402.11258]. Data gaps, irregular cadence, and varying errors are natively handled by direct summation; FFT-based acceleration requires special treatment.

## 5. Limitations, Robustness, and Extensions

The classical LSP assumes the true signal is sinusoidal and noise is stationary, white, and Gaussian. In non-Gaussian or heavy-tailed situations, the standard $\ell_2$ least-squares approach is sensitive to outliers and tail events; robust periodograms using the $\ell_1$ (sum-of-absolute residuals) norm are more resilient, though at increased computational cost (nonlinear minimization or linear programming at each frequency) [2405.12324].

The LSP is sub-optimal for non-sinusoidal periodicities, as the signal power is distributed over higher harmonics, reducing detection efficiency compared to multi-harmonic, template-matched, or Bayesian model comparison approaches [2505.14778]. For colored ("red") noise, the exponential null distribution is invalid, and significance estimation requires explicit noise modeling (e.g., via Whittle likelihoods and frequency-dependent FAPs) [2512.18205].

Multiple-frequency and multiband generalizations extend the model space to $m$-dimensional "omnigrams": fits to arbitrary bases, joint frequency searches, and applications in high-dimensional time-series pipelines [1502.01344, 2601.04552].

## 6. False-Alarm Probability, Significance, and Practical Recommendations

FAP can be estimated analytically (for white noise) or via bootstrapping (resampling residuals), especially in the regime of correlated or red noise where analytic formulae are invalid:
- For $M$ independent frequencies, $\mathrm{FAP} = 1 - [1-\exp(-z)]^M$ for an LSP peak of height $z$ [1301.4826].
- The number of independent frequencies should be estimated (via spectral window/correlation analysis) to adjust FAP for oversampling and window effects [1807.01595, 2206.05411].
- In practical cases, bootstrap resampling or Monte Carlo simulation of the periodogram under the null is recommended to calibrate significance [1412.0467, 1912.06970, 2402.11258].

For trend- or offset-contaminated data, Bayesian or GLS periodograms with simultaneous offset/trend fitting are preferred to pre-detrending, which can distort genuine long-period signals [1412.0467, 1712.08235]. For large surveys or real-time contexts, optimized GPU/NUFFT implementations are necessary to maintain tractability [2105.04006, 2409.08090, 1007.1658].

## 7. Applications and Software Implementations

The LSP and its generalizations have become central to exoplanet radial-velocity searches, stellar rotation analysis, survey time-domain pipelines, and a host of astrophysical variability studies. Widely used software implementations include:
- **astropy.stats.LombScargle** and **scipy.signal.lombscargle** (Python): support classical, generalized, and Bayesian evaluations, GPU acceleration via `nifty-ls`, and robust FAP via built-in methods [2409.08090, 1412.0467].
- **nifty-ls**: direct integration with Astropy, leveraging the `finufft`/`cufinufft` backends for high-throughput, high-precision calculations [2409.08090].
- Custom, vectorized or low-level C/Fortran codes for maximum performance in large-scale survey processing [2105.04006, 1007.1658].
- Bayesian and robust $\ell_1$ extensions for heavy-tailed or systematically contaminated datasets [2405.12324].

A detailed end-to-end workflow involves: selection of frequency grid; computation of weighted, time-shifted sums; model normalization; FAP calibration (via analytic, bootstrap, or red-noise approaches); and post hoc model selection among candidate frequencies or composite hypotheses (multiharmonic, template, Bayesian model comparison) [1412.0467, 2512.18205, 2601.04552].

---

**References**:  
- Mortier et al., "BGLS: A Bayesian formalism for the generalised Lomb-Scargle periodogram" [1412.0467]  
- Olspert et al., "Estimating activity cycles with probabilistic methods I. Bayesian Generalised Lomb-Scargle Periodogram with Trend" [1712.08235]  
- Dhaygude & Desai, "Generalized Lomb-Scargle analysis of $^{36}$Cl decay rate measurements at PTB and BNL" [1912.06970]  
- Pasumarti & Desai, "Generalized Lomb-Scargle Analysis of 22 years of Super-Kamiokande solar $^8$B neutrino data" [2402.11258]  
- Lin et al., "Lomb-Scargle periodograms struggle with non-sinusoidal supermassive BH binary signatures in quasar lightcurves" [2505.14778]  
- Ejaz et al., "Red noise-based false alarm thresholds for astrophysical periodograms via Whittle's approximation to the likelihood" [2512.18205]  
- Makarov et al., "Robust 1-norm periodograms for analysis of noisy non-Gaussian time series with irregular cadences" [2405.12324]  
- Gowanlock et al., "Fast Period Searches Using the Lomb-Scargle Algorithm on Graphics Processing Units for Large Datasets and Real-Time Applications" [2105.04006]  
- Townsend, "Fast Calculation of the Lomb-Scargle Periodogram Using Graphics Processing Units" [1007.1658]  
- VanderPlas & Ivezić, "Periodograms for Multiband Astronomical Time Series" [1502.01344]  
- Scargle, J. D. (1982).  
- Zechmeister & Kürster, "The generalised Lomb-Scargle periodogram" (2009)  

This summary synthesizes technical details of the LSP, variants, and computational strategies, focusing on rigor and research-driven best practices.

Source: https://www.emergentmind.com/topics/lomb-scargle-periodogram