This repository contains a Jupyter notebook tutorial demonstrating how to carry out leave-one-out cross-validation (LOO-CV) using the Pareto-smoothed importance sampling (PSIS) approximation. The tutorial uses a synthetic dataset example from Welbanks et al. 2023 and the arviz
package (link).
In this tutorial, you will learn how to:
- Perform LOO-CV using PSIS.
- Use the
arviz
package for LOO-CV. - Apply these techniques to exoplanet atmospheric analysis using synthetic data.
The main steps covered in the notebook include:
- Introduction to LOO-CV: An overview of the method and its applications.
- Required Packages: Importing necessary libraries including
numpy
,matplotlib
,arviz
, andspectres
. - Generating Pointwise Log Likelihood: Instructions on how to generate the required data for LOO-CV.
- Performing LOO-CV: Detailed steps to carry out LOO-CV using the provided dataset.
- Analysis and Visualization: Techniques to analyze and visualize the results.
If you find this tutorial helpful, please consider citing the following papers:
-
Welbanks et al. 2023, On the Application of Bayesian Leave-one-out Cross-validation to Exoplanet Atmospheric Analysis. Link
-
McGill et al. 2023, First semi-empirical test of the white dwarf mass-radius relationship using a single white dwarf via astrometric microlensing. Link
-
Nixon et al. 2024, Methods for Incorporating Model Uncertainty into Exoplanet Atmospheric Analysis. Link
Ensure you have the following packages installed:
numpy
matplotlib
arviz
spectres
You can install them using pip:
pip install numpy matplotlib arviz spectres
- Clone the repository:
git clone https://github.com/your-username/loocv_tutorial.git
- Navigate to the repository directory:
cd loocv_tutorial
- Open the Jupyter notebook:
jupyter notebook loocv_tutorial.ipynb
- Follow the steps in the notebook to perform LOO-CV on the provided synthetic dataset.
Contributions are welcome! Please feel free to submit a Pull Request.
This project is licensed under the MIT License.