A Julia port of the EMpht.c program, used for fitting Phase-Type distributions via an EM algorithm. Modified for my masters thesis to run in parallel, based on Patrick Laub's code. See the website and the actual thesis.
The original C — which is available on Søren Asmussen's website — is well documented and has a decent performance for phase-type distributions with a small or moderate number of phases. However it is quite slow for when the number of phases is large (>= 20), and the UX is very old-school Unix.
This port is much simpler (~300 lines of Julia compared with ~1700 lines of C), and faster. EMpht.jl reads all necessary information from a JSON file (the number of phases to fit, the special structure of the phase-type, the sample to fit); see the example*.json files which are ports of the examples in the EMpht.c user's guide. It is faster because of it uses: i) a fast matrix multiplication implementation, ii) a lower-order ODE solver, iii) more of a modern CPU's capabilities.
The relevant papers for the algorithm are S. Asmussen, O. Nerman & M. Olsson, Fitting phase-type distribution via the EM algorithm, Scand. J. Statist. 23, 419-441 (1996), and M. Olsson, Estimation of Phase-Type Distributions from Censored Data, Scand. J. Statist. 23, 443-460 (1996).