This repository contains code for T-Rex, an expectation-maximization (EM) algorithm for robustly fitting a statistical factor model. It fits a factor model by solving the maximum likelihood estimation problem
where the variables are the diagonal matrix
First install the packages listed in 'requirements.txt'.
- To recreate Figure 1, run
MSE_vs_samples.ipynb. - To recreate Figure 2, run
MSE_vs_samples.ipynb. - To recreate Figure 3 and 4, run
TRex_vs_Tyler.ipynb. - To recreate Figure 5 and 6, run
collect_face_data.pyfollowed byplot_recovered_faces.pyandplot_all_test_faces.py.
If you wish to cite this work you may use the following BibTex:
@article{Cederberg2025,
title={T-Rex: Fitting a Robust Factor Model via Expectation-Maximization},
author={Cederberg, Daniel},
journal={arXiv preprint arXiv:2505.12117},
year={2025}
}