Documentation for PHASE, version 2.1 Algorithm by Matthew Stephens1, Nicholas J. Smith, and Peter Donnelly. Code by Matthew Stephens, with contributions from Na Li. June…