*This jupyter notebook is part of a collection of notebooks on various topics discussed during the Time Domain Astrophysics course delivered by Stefano Covino at the [Università dell'Insubria](https://www.uninsubria.eu/) in Como (Italy). Please direct questions and suggestions to [stefano.covino@inaf.it](mailto:stefano.covino@inaf.it).*
- What we want to be able to do is to detect variability and measure the period in the face of both noisy and incomplete data. Instead we'll use Fourier decomposition to get a more useful tool for actual data analysis.
- For a periodic signal we have:
$$y(t+P)=y(t),$$ where $P$ is the period.
- We can create a *phased light curve* that plots the data as function of phase:
- Let's take the case where the data are drawn from a single sinusoidal signal:
$$y(t)=A \sin(\omega t+\phi)+\epsilon$$
- and determine whether or not the data are indeed consistent with periodic variability and, if so, what is the period.
- This model is **non-linear** in the frequency term, $\omega$ and the phase, $\phi$ and therefore We rewrite the argument as $\omega(t−t_0)$ (reexpressing the phase term) and use trigonometrics identies to rewrite the model as:
$$y(t)=a \sin(\omega t)+b \cos(\omega t)$$
- where
$$A=(a^2+b^2)^{1/2} \text{ and } \phi=\tan^{−1}(b/a)$$
- The model is now linear with respect to coefficients $a$ and $b$ (and nonlinear only with respect to frequency, $\omega$).
- where $y_i$ is the measurement (e.g., the brightness of a star) taken at time $t_i$.
- With a lof of math we do not report here, and assuming uniform priors on $a, b, \omega$, and $\sigma$ (which gives nonuniform priors on $A$ and $\phi$), the posterior distribution of parameters can be simplified to:
- To determine if our source is variable or not, we first compute $P_{\rm LS}(\omega)$ and then model the odds ratio for our variability model vs. a no-variability model.
- If our variability model is "correct", then the peak of $P(\omega)$ gives the best $\omega$ and the $\chi^2$ at $\omega = \omega_0$ is $N$.
This notebook is provided as [Open Educational Resource](https://en.wikipedia.org/wiki/Open_educational_resources). Feel free to use the notebook for your own purposes. The text is licensed under [Creative Commons Attribution 4.0](https://creativecommons.org/licenses/by/4.0/), the code of the examples, unless obtained from other properly quoted sources, under the [MIT license](https://opensource.org/licenses/MIT). Please attribute the work as follows: *Stefano Covino, Time Domain Astrophysics - Lecture notes featuring computational examples, 2025*.
This notebook is provided as [Open Educational Resource](https://en.wikipedia.org/wiki/Open_educational_resources). Feel free to use the notebook for your own purposes. The text is licensed under [Creative Commons Attribution 4.0](https://creativecommons.org/licenses/by/4.0/), the code of the examples, unless obtained from other properly quoted sources, under the [MIT license](https://opensource.org/licenses/MIT). Please attribute the work as follows: *Stefano Covino, Time Domain Astrophysics - Lecture notes featuring computational examples, 2026*.