This page contains a list of hopefully useful notebooks and bits of code I've written up at one time or another, generally related to galaxy spectral fitting, Bayesian statistics and sampling methods.
With Kartheik Iyer, I ran two unconference sessions on galaxy spectral fitting at the STScI multi-object spectroscopy conference in 2021. We wrote a series of Google Colab notebook exercises covering a range of topics, including basic usage of Bagpipes, the effects of priors and data quality on spectral fitting, fitting spectroscopic data, sampling methods, and GPU computing with Google Tensorflow.
Whilst attending the ICIC data analysis workshop, I wrote up a couple of Jupyter notebooks on using Gibbs sampling to sample from posterior distributions with hundreds to thousands of dimensions. I also wrote up a basic Python module for Gibbs sampling from general probability distributions.
I wrote up a basic Python package for nested sampling whilst reading Skilling 2006 to learn more about how the method works. This isn't the most efficient code to use on real data, but it might be a useful guide if you're looking to write something similar to understand the nested sampling algorithm better.
This repository contains a series of Jupyter notebooks that will take you through writing a very basic galaxy spectral fitting code.
While getting to grips with mpi4py, I wrote this code, which automatically splits up an array and sends out equally sized chunks to each core, trivially speeding up repetitive tasks.
I wrote SpectRes to resample spectroscopic data with associated uncertainties. I also published a quick research note on arXiv explaing the method.