Astrophysics & machine learning

Joshua Fagin, Ph.D.

Postdoctoral Researcher
Stony Brook University

I use the changing light of quasars to study black holes, the galaxies that lens them, and the expansion of the Universe.

Working with Simon Birrer, I combine dynamical microlensing simulations with machine learning to turn irregular light curves into measurements and event forecasts for Rubin Observatory’s Legacy Survey of Space and Time.

Joshua Fagin

01 / Research

Learning from a changing sky.

I build physical simulators and inference methods to connect time-domain observations to the systems that produce them.

Labeled Hubble image of RX J1131−1231 showing four quasar images, the central foreground lens galaxy, and the lensed host-galaxy arcs View HST image
Observed with Hubble, not a simulation. ESA/Hubble, NASA, Suyu et al. · CC BY 4.0. Labels added.

A real gravitational lens

One quasar.
Four views of a changing disk.

In RX J1131−1231, a foreground galaxy bends the light of a distant quasar into four images. Each follows a different path, so the same intrinsic variations arrive at different times.

Stars in the lens galaxy add a different microlensing signal to each image. Separating these signals lets us study accretion disks and compact objects while measuring the time delays that probe cosmic expansion.

Rubin Observatory / LSST

A decade of light.
New ways to read it.

The Legacy Survey of Space and Time repeatedly images the southern sky in six bands. For quasars, that means long, multicolor records of accretion and microlensing, with irregular sampling and seasonal gaps.

I am developing latent-SDE models trained on physical simulations to make use of these light curves as they grow. My goal is to connect survey monitoring to measurements of disk structure, microlens populations, and cosmological time delays, while guiding follow-up of the most informative events.

About Rubin’s survey
Vera C. Rubin Observatory on Cerro Pachón beneath a blue and orange twilight sky View observatory
Rubin Observatory on Cerro Pachón, Chile. RubinObs/NOIRLab/NSF/AURA · CC BY 4.0. Archival photograph, 2023.

Reconstruct

Recover light curves through gaps and separate shared intrinsic variability from image-specific microlensing.

Infer

Use the full time series to constrain physical parameters and their uncertainties.

Identify & forecast

Find past caustic crossings and predict future high-magnification events for multiband and spectroscopic follow-up.

Diagram connecting a reverberating black-hole accretion disk, a foreground lens galaxy with moving stars, and simulated quasar light curves View figure
Two complementary probes of one accretion disk. Illustration and simulated Q2237+0305 light curves from my research.
01

Quasar accretion disks

Reverberation measures how an accretion disk responds to changing illumination. Microlensing magnifies different parts of the disk. Together, they can reveal its size, temperature structure, and inner-disk structure.

02

Dynamical microlensing

Stars move, so the magnification pattern evolves. I developed Microcaustics to make these simulations practical on GPUs and study how stellar motion and mass distributions affect inference.

03

Cosmology & compact objects

Strongly lensed quasars probe compact matter in distant galaxies and provide time delays for measuring cosmic expansion. My goal is joint time-series inference that accounts for microlensing rather than treating it only as a nuisance.

Machine learning for inference

From sparse observations
to physical models.

My latent stochastic differential equation (SDE) framework reconstructs irregular quasar light curves and infers black-hole and accretion-disk properties. It combines learned variability with a physical model of disk reprocessing.

Current work extends this approach to simulation-based inference with a pretrained Transformer encoder and tests it on observed ZTF and DES quasars. For lensed systems, I am developing methods to identify past crossings and forecast future high-magnification events for follow-up.

Read the latent-SDE paper
Observed ZTF quasar light curve with latent-SDE posterior samples and uncertainty intervals for inpainting and extrapolation View figure
An observed, unlensed ZTF quasar. Blue points are data; orange curves and intervals are posterior reconstructions. From current work in preparation.
Black-hole masses inferred for 550 ZTF quasars versus catalog virial estimates, with error bars, an equality line, and RMSE of 0.45 dex View figure
Black-hole mass inference for 550 ZTF quasars with supplied redshifts, compared with catalog virial estimates. From current work in preparation.

The science in motion

A magnifying glass that moves.

These physical simulations show how evolving caustics change a quasar’s spectrum and reverberation response. Choose one of the two animations below, then select Play animation.

Simulated Q2237 image-B magnification map, six-band disk reverberation responses and daily light curves, with mock LSST observations and one labeled caustic-crossing time
Microlensing changes more than brightness. The transfer function shows the disk’s relative response at different delays after a brief change in central illumination. Microlensing reweights this response, shifting its mean lag (arrows). Dashed curves show the unmicrolensed response and solid curves include microlensing. Below, capped points are mock LSST observations, with the caustic crossing marked at 600 days. Simulated Q2237+0305 image B.
Simulated moving microlensing map, evolving quasar spectrum, wavelength-dependent magnification, and six-band daily light curves with mock LSST observations and a labeled caustic crossing
One crossing, many wavelengths. A simulated magnification pattern, evolving disk continuum, empirical emission lines, and Rubin bandpasses connect the source physics to daily multiband light curves. Points with capped error bars are mock LSST observations; the caustic-crossing time is marked. Simulated Q2237+0305 image B.

02 / Publications

Selected work.

  1. 2025
  2. 2025
  3. 2025
  4. 2025
  5. 2024
  6. 2024
  7. 2024
Current manuscripts Work in progress

Listed separately from refereed publications. Public paper links will be added when available.

  • Microcaustics: Fast GPU-Accelerated Dynamical Microlensing of Time-Dependent Extended Sources

    J. Fagin et al. · Manuscript · Software available ↗

  • Neglecting Dynamical Microlensing Can Bias Accretion Disk Size Measurements at a Population Level

    J. Fagin et al. · In preparation

  • Physics-Embedded Simulation-Based Inference of Quasar Accretion Disk Reprocessing with Latent Stochastic Differential Equations

    J. Fagin et al. · In preparation

  • Automated Caustic-Crossing Detection and Accretion-Disk Inference from Quasar Microlensing

    J. Chan, J. Fagin, M. O’Dowd & S. Miskiewicz · Submitted to A&A

03 / Scientific software

Tools to make the science possible.

Open code, physical models, and worked examples for time-domain astronomy.

Python · PyTorch · Triton

Microcaustics

A GPU-accelerated simulator for dynamical gravitational microlensing of extended, evolving sources. Moving stars, stellar mass distributions, relativistic disks, spectra, and caustic labels can be combined in one light-curve workflow.

Variability & disk physics

Quasar ML

Physics-embedded latent SDEs for joint modeling of quasar variability and accretion-disk reprocessing.

Continuous-time inference

Latent SDE

Reconstructing irregular quasar light curves and inferring black-hole properties with neural stochastic dynamics.

Event forecasting

Quasar Event Predictor

Recurrent neural networks for predicting microlensing high-magnification events in LSST-like monitoring.

04 / Background

Research, teaching & community.

LinkedIn

Appointments & education

  1. 2026–present

    Stony Brook University

    Postdoctoral Researcher in Astrophysics and Machine Learning
    Working with Simon Birrer

  2. 2025–2026

    CUNY & American Museum of Natural History

    Postdoctoral Researcher
    Working with Matthew O’Dowd

  3. 2020–2025

    CUNY Graduate Center

    Ph.D. in Physics
    Thesis on machine learning for quasar variability and strong lensing ↗

  4. 2016–2020

    Cornell University

    B.S. in Physics & B.S. in Mathematics

Science collaborations

I co-lead a quasar-variability task force in the Rubin AGN Science Collaboration and participate in the Dark Energy and Strong Lensing Science Collaborations. I am also a member of the FutureLens Collaboration.

Teaching

I taught nine undergraduate physics laboratory sections at CUNY Lehman College in the Bronx, covering mechanics, electromagnetism, and physics of sound.

I develop open scientific-software tutorials and am interested in making time-series inference, GPU computing, and machine learning more accessible to astronomy students.

Across astronomy and AI

My latent-SDE work received a spotlight presentation at the ICLR 2023 Physics for Machine Learning Workshop. I have presented research at astronomy and machine-learning meetings, including Rubin science-collaboration meetings.

Let’s connect

Questions, ideas,
or a new collaboration?

I’m interested in quasar physics, strong lensing, time-domain surveys, and machine learning for physical science.

Department of Physics and Astronomy
Stony Brook University

Research figure