Tutorial: Generating Synthetic Light Curves¶
This notebook demonstrates how to use the pgmuvi.synthetic module to:
Draw synthetic light curves from a GP with known hyperparameters
Verify that
pgmuvican recover those hyperparametersSimulate multiband observations with different cadences
Why synthetic data?
Synthetic experiments (sometimes called simulation-based calibration or parameter recovery tests) are essential for:
Validating that the fitting pipeline is correctly implemented
Understanding parameter degeneracies
Setting realistic expectations about what the data can constrain
Survey planning (e.g., what cadence is needed to detect a given period?)
Prerequisites: the pgmuvi_tutorial notebook.
1. Setup¶
[ ]:
import numpy as np
import matplotlib.pyplot as plt
import pgmuvi
import pgmuvi.synthetic
2. Generating a Synthetic Single-Band Light Curve¶
We specify a set of hyperparameters — one mixture component with a period of 100 days and a modest bandwidth — and draw a realisation from the corresponding GP.
[ ]:
# TODO: Expand with pgmuvi.synthetic API calls once this tutorial is developed
# The pgmuvi.synthetic module contains tools for drawing GP samples.
# Placeholder: define observation grid
rng = np.random.default_rng(0)
times = np.sort(rng.uniform(0, 500, 200))
print(f"Synthetic observation grid: {len(times)} points over {times[-1]:.0f} days")
3. Fitting the Synthetic Data¶
We fit a GP model to the synthetic data and check that the inferred period matches the input period.
[ ]:
# TODO: Expand with GP MAP fitting via fit(model="1D") and compare inferred
# parameters against the true synthetic values. Optionally call fit_LS() first
# to inspect candidate periods / diagnostics.
4. Parameter Recovery: Varying Cadence¶
Here we repeat the synthetic experiment with different observation cadences to understand the minimum sampling required to detect the 100-day period.
[ ]:
# TODO: Loop over cadences and summarise recovery fraction
5. Multiband Synthetic Data¶
We demonstrate generating a synthetic two-band light curve where the variability amplitude changes with wavelength.
[ ]:
# TODO: Expand with 2D synthetic example using pgmuvi.synthetic
Next Steps¶
See the
pgmuvi.syntheticAPI reference in the documentation for the full list of available functions.For MCMC-based parameter uncertainty: MCMC support (
mcmc()) is planned for a future release and is not yet available.For sampling quality assessment, see the Preprocessing tutorial.